search for: _str

Displaying 20 results from an estimated 30 matches for "_str".

Did you mean: __str
2013 Feb 21
2
[PATCH] xen: consolidate implementations of LOG() macro
...32/asm-offsets.c +++ b/xen/arch/arm/arm32/asm-offsets.c @@ -8,6 +8,7 @@ #include <xen/config.h> #include <xen/types.h> #include <xen/sched.h> +#include <xen/bitops.h> #include <public/xen.h> #include <asm/current.h> @@ -18,13 +19,6 @@ #define OFFSET(_sym, _str, _mem) \ DEFINE(_sym, offsetof(_str, _mem)); -/* base-2 logarithm */ -#define __L2(_x) (((_x) & 0x00000002) ? 1 : 0) -#define __L4(_x) (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x)) -#define __L8(_x) (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L...
2019 Jun 28
2
Re: [PATCH libnbd v3] python: Raise a custom exception containing error string and errno.
...' > + > +Error.string = property (lambda self: self.args[0]) > + > +def _errno (self): > + import errno > + try: > + return errno.errorcode[self.args[1]] > + except KeyError: > + return None > +Error.errno = property (_errno) > + > +def _str (self): > + if self.errno: > + return (\"%%s (%%s)\" %% (self.string, self.errno)) > + else: > + return (\"%%s\" %% self.string) > +Error.__str__ = _str Looks good to me now! Thanks for figuring this out while I was struggling with reading lo...
2019 Jun 28
3
[PATCH libnbd v3] python: Raise a custom exception containing error string and errno.
Following Eric's suggestions from v2, this adds .string, .errno and .__str__ properties. The .string property returns the error string. The .errno property returns the errno (from the errno module), or None. The __str__ property makes the exception nicely printable. Rich.
2009 Mar 25
1
"xm dmesg" ring buffer size option?
I have a large system with pretty voluminous boot time messages that are exceeding the capacity of the ring buffer displayed by "xm dmesg" (i.e., the early messages are lost, and I see only the last messages). With a regular, non-Xen kernel, I use "log_buf_len=size" to enlarge the printk ring buffer size, but this boot option doesn''t seem to work for Xen. Anyone have
2002 Jan 07
2
rsync-2.5.1 / popt patches
...5,7 @@ /*@only@*/ char * xstrdup (const char *str); -#if HAVE_MCHECK_H && defined(__GNUC__) +#if defined(HAVE_MCHECK_H) && defined(__GNUC__) #define vmefail() (fprintf(stderr, "virtual memory exhausted.\n"), exit(EXIT_FAILURE), NULL) #define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str)) ) #else EAGLE> type lcl_popt:popt_h.gdiff --- ref_popt:popt.h Fri Feb 23 19:32:22 2001 +++ lcl_popt:popt.h Sun Jan 6 08:42:28 2002 @@ -1,3 +1,4 @@ +/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_popt:popt.tpu on 6-JAN...
2019 Jun 28
0
Re: [PATCH libnbd v3] python: Raise a custom exception containing error string and errno.
...self: self.args[0]) > > + > > +def _errno (self): > > + import errno > > + try: > > + return errno.errorcode[self.args[1]] > > + except KeyError: > > + return None > > +Error.errno = property (_errno) > > + > > +def _str (self): > > + if self.errno: > > + return (\"%%s (%%s)\" %% (self.string, self.errno)) > > + else: > > + return (\"%%s\" %% self.string) > > +Error.__str__ = _str > > Looks good to me now! Thanks for figuring this out whi...
2019 Jun 28
0
[PATCH libnbd v3] python: Raise a custom exception containing error string and errno.
...r +did not correspond to a system call failure). +''' + +Error.string = property (lambda self: self.args[0]) + +def _errno (self): + import errno + try: + return errno.errorcode[self.args[1]] + except KeyError: + return None +Error.errno = property (_errno) + +def _str (self): + if self.errno: + return (\"%%s (%%s)\" %% (self.string, self.errno)) + else: + return (\"%%s\" %% self.string) +Error.__str__ = _str + "; List.iter (fun (n, i) -> pr "%-30s = %d\n" n i) constants; diff --git a/python/t/610-ex...
2019 Jun 28
1
Re: [PATCH libnbd v3] python: Raise a custom exception containing error string and errno.
...mber is effectively lost, should that really be an > issue. Maybe we want two fields, both .errno (string name, or None if Python errno.errorcode couldn't map it to a name), and .errnum (raw numeric value, accessible no matter what). Maybe as simple as this (or with one further tweak to __str__ to at least output .errnum when .errno is None): diff --git i/generator/generator w/generator/generator index 7c2fb59..9192988 100755 --- i/generator/generator +++ w/generator/generator @@ -3944,11 +3944,14 @@ from libnbdmod import Error Error.__doc__ = ''' Exception thrown when th...
2003 Oct 08
4
OS/390 openssh
...<bs2cmd.h> +/* + * record_failed_login_attempt: "attempted login failed" interface function + */ +void +record_failed_login_attempt(const char *user, const char *reason, const char *ipaddr, int port) +{ + char buf[1024]; + char cmd[1024]; + bs2cmd_rc rc; + int flags = BS2CMD_FLAG_STRIP; + + snprintf(buf, sizeof buf, "/TYPE %% OPENSSH %s '%s' FROM '[%s]:%d'", + reason, user, ipaddr, port); + strnvis(cmd, buf, sizeof(buf), VIS_SAFE|VIS_OCTAL); + (void) bs2cmd(cmd, &rc, BS2CMD_DEFAULT, flags); +} +#endif diff -bur openssh-3.7.1p2.orig/auth-pa...
2018 Dec 08
2
Solr
...quot; name="add-schema-fields"> - <lst name="typeMapping"> - <str name="valueClass">java.lang.String</str> - <str name="fieldType">text_general</str> - <lst name="copyField"> - <str name="dest">*_str</str> - <int name="maxChars">256</int> - </lst> - <!-- Use as default mapping instead of defaultFieldType --> - <bool name="default">true</bool> - </lst> - <lst name="typeMapping"> - <str name="valueClass&qu...
2019 Aug 10
0
[PATCH libnbd 8/9] generator: Enhance Flags/OFlags with optional "all flags" mask.
...let all = List.fold_left (lor) 0 (List.map snd flags) in + let n = sprintf "LIBNBD_%s_ALL" flag_prefix in + pr "#define %-40s %d\n" n all; + ); + pr "\n"; ) all_flags; List.iter ( fun (n, i) -> @@ -4606,12 +4613,17 @@ Error.__str__ = _str pr "\n" ) all_enums; List.iter ( - fun { flag_prefix; flags } -> + fun { flag_prefix; all_flags_bitmask; flags } -> List.iter ( fun (flag, i) -> let flag = sprintf "%s_%s" flag_prefix flag in pr "%-3...
2018 Dec 09
0
Solr
...ma-fields"> > - <lst name="typeMapping"> > - <str name="valueClass">java.lang.String</str> > - <str name="fieldType">text_general</str> > - <lst name="copyField"> > - <str name="dest">*_str</str> > - <int name="maxChars">256</int> > - </lst> > - <!-- Use as default mapping instead of defaultFieldType --> > - <bool name="default">true</bool> > - </lst> > - <lst name="typeMapping"> >...
2018 Dec 05
5
Solr
THen the Squat shall be maintained until the SOlr plugin is upgraded, as Squat does resolve the problem (fts, partial search, etc...) On 2018-12-05 12:20, Aki Tuomi wrote: > It seems we forgot to document that "break-imap-search" was dropped in v2.3. That has now been updated. > > Also Solr does not support prefix/substring search unless you configure solr to support it.
2019 Jun 07
1
Problem with opusfile & ndk
Hi Xiph.org Team. We are using opusfile library <https://github.com/xiph/opusfile> for streaming *.opus* audio in our projects. But now we have a problem with building opusfile library for android with *ndk-build*. In particular, with arm64-v8a platform: Google removed <sys/timeb.h> from android. And now building opusfile with nkd-build crashes with error "fatal error:
2019 Apr 23
2
SolrCore 'dovecot' is not available due to init failure: fieldType 'text_general' not found in the schema
Hello, it seems an mismatch of schema file provided by dovecot-2.3.5.2 [root at mail conf]# pwd /var/solr/data/dovecot/conf # Below solrconfig.xml is from Solr-8.0.0. [root at mail conf]# grep text_general solrconfig.xml <str name="queryAnalyzerFieldType">text_general</str> field types. Text content will be indexed as "text_general" as <str
2019 Aug 10
0
[PATCH libnbd 1/5] python: Change aio_buffer into nbd.Buffer class.
...o_buffer"; + "aio_buffer_from_bytearray"; + "aio_buffer_to_bytearray"; + "aio_buffer_size" ] @ List.map fst handle_calls); pr " { NULL, NULL, 0, NULL }\n"; pr "};\n"; pr "\n"; @@ -4502,17 +4506,28 @@ Error.__str__ = _str pr "\ -# AIO buffer functions. -def aio_buffer (len): - '''allocate an AIO buffer used for nbd.aio_pread and nbd.aio_pwrite''' - return libnbdmod.alloc_aio_buffer (len) - -def aio_buffer_from_bytearray (ba): - '''create an AIO buffer...
2019 Apr 23
3
SolrCore 'dovecot' is not available due to init failure: fieldType 'text_general' not found in the schema
...> <lst name="typeMapping"> > <str name="valueClass">java.lang.String</str> > <str name="fieldType">text_general</str> > <lst name="copyField"> > <str name="dest">*_str</str> > <int name="maxChars">256</int> > </lst> > <bool name="default">true</bool> > </lst> > <lst name="typeMapping"> > <str name="valueClass">java.lang...
2019 Aug 10
7
[PATCH libnbd 0/5] WIP: python: Add test for doing asynch copy.
This doesn't yet work. However it does make me more convinced than ever that we really need to sort out persistent buffer lifetimes in the library (similar to what we did for closures). Rich.
2019 Aug 10
0
[PATCH libnbd 3/9] generator: Add Enum type for enumerated types / unions.
...t_error } = | BytesIn (n, _) -> pr " PyBuffer_Release (&%s);\n" n | BytesPersistIn _ | BytesOut _ | BytesPersistOut _ -> () | Closure _ -> () + | Enum _ -> () | Int _ -> () | Int64 _ -> () | Path n -> @@ -4505,6 +4543,15 @@ Error.__str__ = _str "; + List.iter ( + fun { enum_prefix; enums } -> + List.iter ( + fun (enum, i) -> + let enum = sprintf "%s_%s" enum_prefix enum in + pr "%-30s = %d\n" enum i + ) enums; + pr "\n" + ) all_enums; Li...
2020 Sep 11
0
[libnbd PATCH v2 1/5] api: Add xxx_MASK constant for each Flags type
...%s;\n" flag + ) flags; + pr " ]\n"; pr "end\n"; pr "\n" ) all_flags; diff --git a/generator/Python.ml b/generator/Python.ml index 71368c6..fd09eae 100644 --- a/generator/Python.ml +++ b/generator/Python.ml @@ -696,11 +696,14 @@ Error.__str__ = _str ) all_enums; List.iter ( fun { flag_prefix; flags } -> + let mask = ref 0 in List.iter ( fun (flag, i) -> let flag = sprintf "%s_%s" flag_prefix flag in - pr "%s = %d\n" flag i + pr "%s = 0x%02x\n&q...