Cámaras compactas Sony y Panasonic
USD211 Sony DSC-W330 Caacute;mara digital compacta, sin visor / Sensor SuperHAD de 14,10 MP efectivos / Objetivo (en 35 mm) 26,0 - 105,0 mm / Zoom 4x (oacute;ptico) / Soportes compatibles SD Card, MemoryStick Duo, MemoryStick Pro Duo, MemoryStick Pro-HG Duo, microSDHC, MemoryStick Pro Duo High Speed / Pantalla TFT de 3,00 pulgadas USD 220 Sony DSC-W350 Caacute;mara digital compacta, sin visor / Sensor SuperHAD de 14,10 MP efectivos Objetivo (en 35 mm) 26,0 - 105,0 mm / Zoom 4x (oacute;ptico) / Soportes compatibles SD Card, MemoryStick Duo, MemoryStick Pro Duo, SDHC, MemoryStick Pro-HG Duo, MemoryStick Pro Duo High Speed / Pantalla TFT de 2,70 pulgadas Sony DSC-HX1 USD 495 Panasonic FZ35/FZ38 USD 395 Panasonic TZ10/ZS7 USD 369 Panasonic TZ8/ZS5 USD 299
ksh completion
hi, (this is a re-post) make tab completion work for '=', '`', '[', ':', and '$' - pulled from mksh by Alexander Polakov (also posted to tech recently). closes pr 6006 too. comments/ok? Index: edit.c === RCS file: /home/okan/hack/open/cvs/src/bin/ksh/edit.c,v retrieving revision 1.34 diff -u -p -r1.34 edit.c --- edit.c 20 May 2010 01:13:07 - 1.34 +++ edit.c 14 Mar 2011 09:59:27 - @@ -365,6 +365,11 @@ x_file_glob(int flags, const char *str, continue; } + /* specially escape escaped [ or $ or ` for globbing */ + if (escaping (toglob[i] == '[' || + toglob[i] == '$' || toglob[i] == '`')) + toglob[idx++] = QCHAR; + toglob[idx] = toglob[i]; idx++; if (escaping) escaping = 0; @@ -378,7 +383,7 @@ x_file_glob(int flags, const char *str, s = pushs(SWSTR, ATEMP); s-start = s-str = toglob; source = s; - if (yylex(ONEWORD) != LWORD) { + if (yylex(ONEWORD|LQCHAR) != LWORD) { source = sold; internal_errorf(0, fileglob: substitute error); return 0; @@ -821,7 +826,7 @@ x_escape(const char *s, size_t len, int int rval = 0; for (add = 0, wlen = len; wlen - add 0; add++) { - if (strchr(\#$'()*;=?[\\]`{|}, s[add]) || + if (strchr(\#$'()*:;=?[\\]`{|}, s[add]) || strchr(ifs, s[add])) { if (putbuf_func(s, add) != 0) { rval = -1; Index: lex.c === RCS file: /home/okan/hack/open/cvs/src/bin/ksh/lex.c,v retrieving revision 1.45 diff -u -p -r1.45 lex.c --- lex.c 9 Mar 2011 09:30:39 - 1.45 +++ lex.c 14 Mar 2011 09:59:27 - @@ -411,6 +411,13 @@ yylex(int cf) } } break; + case QCHAR: + if (cf LQCHAR) { + *wp++ = QCHAR; + *wp++ = getsc(); + break; + } + /* FALLTHROUGH */ default: *wp++ = CHAR, *wp++ = c; } Index: lex.h === RCS file: /home/okan/hack/open/cvs/src/bin/ksh/lex.h,v retrieving revision 1.11 diff -u -p -r1.11 lex.h --- lex.h 29 May 2006 18:22:24 - 1.11 +++ lex.h 14 Mar 2011 09:59:27 - @@ -113,6 +113,7 @@ typedef union { #define CMDWORD BIT(8) /* parsing simple command (alias related) */ #define HEREDELIM BIT(9) /* parsing ,- delimiter */ #define HEREDOC BIT(10)/* parsing heredoc */ +#define LQCHAR BIT(11) /* source string contains QCHAR */ #defineHERES 10 /* max in line */
Re: ksh completion
On Tue 2011.03.15 at 12:19 +0200, Paul Irofti wrote: On Tue, Mar 15, 2011 at 04:45:43AM -0400, Okan Demirmen wrote: hi, (this is a re-post) make tab completion work for '=', '`', '[', ':', and '$' - pulled from mksh by Alexander Polakov (also posted to tech recently). This diff doesn't work for me with files containing '['. This is the first character I tested and it failed. $ touch [this] file.txt $ cat [TAB --- nothing You still need to escape these characters. cat \[TAB -- should now work.
Re: ksh completion
On Tue, Mar 15, 2011 at 06:47:22AM -0400, Okan Demirmen wrote: On Tue 2011.03.15 at 12:19 +0200, Paul Irofti wrote: On Tue, Mar 15, 2011 at 04:45:43AM -0400, Okan Demirmen wrote: hi, (this is a re-post) make tab completion work for '=', '`', '[', ':', and '$' - pulled from mksh by Alexander Polakov (also posted to tech recently). This diff doesn't work for me with files containing '['. This is the first character I tested and it failed. $ touch [this] file.txt $ cat [TAB --- nothing You still need to escape these characters. cat \[TAB -- should now work. Okay, tested with all the characters and it works. After reading the diff it looks okay to me, but take into consideration that I'm not well aquainted with this part of the tree and I'm biased because I really want to have this functionality in ksh!
systat(1) support for thousands separators and byte to bit conversion
I wanted to have $ systat ifstat 1 to print meaningful numbers to measure live network throughput. With these two features you are now able to see sth like MBit/s in the ifstat view. B converts to Bits , activates the thousands separator. Comments? OKs? Index: engine.c === RCS file: /cvs/src/usr.bin/systat/engine.c,v retrieving revision 1.13 diff -p -u -p -u -r1.13 engine.c --- engine.c19 Jul 2010 04:41:28 - 1.13 +++ engine.c15 Mar 2011 08:34:00 - @@ -69,6 +69,7 @@ volatile sig_atomic_t gotsig_resize = 0; volatile sig_atomic_t gotsig_alarm = 0; int need_update = 0; int need_sort = 0; +int separate_thousands = 0; SCREEN *screen; @@ -134,7 +135,60 @@ tbprintf(char *format, ...) tb_ptr += len; tb_len -= len; } - + + return len; +} + +int +tbprintft(char *format, ...) + GCC_PRINTFLIKE(1,2) /* defined in curses.h */ +{ + int len; + va_list arg; + char buf[MAX_LINE_BUF]; + + if (tb_ptr == NULL || tb_len = 0) + return 0; + + va_start(arg, format); + len = vsnprintf(buf, tb_len, format, arg); + va_end(arg); + + if (len tb_len) + tb_end(); + else if (len 0) { + int d, s; + int digits, curdigit; + + if (!separate_thousands) { + strlcpy(tb_ptr, buf, tb_len); + return len; + } + + /* count until we hit a non digit. (e.g. the prefix) */ + for (digits = 0; digits len; digits++) + if (!isdigit(buf[digits])) + break; + + curdigit = digits; + d = s = 0; + /* insert thousands separators while copying */ + while (curdigit d tb_len) { + if (curdigit digits curdigit % 3 == 0) + tb_ptr[d++] = ','; + tb_ptr[d++] = buf[s++]; + curdigit--; + } + /* copy the remaining non-digits */ + while (len digits d tb_len) { + tb_ptr[d++] = buf[s++]; + digits++; + } + tb_ptr[d] = '\0'; + tb_ptr += d; + tb_len -= d; + len = d; + } return len; } @@ -672,33 +726,33 @@ print_fld_sdiv(field_def *fld, u_int64_t return; tb_start(); - if (tbprintf(%llu, size) = len) + if (tbprintft(%llu, size) = len) goto ok; tb_start(); size /= d; - if (tbprintf(%lluK, size) = len) + if (tbprintft(%lluK, size) = len) goto ok; if (size == 0) goto err; tb_start(); size /= d; - if (tbprintf(%lluM, size) = len) + if (tbprintft(%lluM, size) = len) goto ok; if (size == 0) goto err; tb_start(); size /= d; - if (tbprintf(%lluG, size) = len) + if (tbprintft(%lluG, size) = len) goto ok; if (size == 0) goto err; tb_start(); size /= d; - if (tbprintf(%lluT, size) = len) + if (tbprintft(%lluT, size) = len) goto ok; err: @@ -729,33 +783,33 @@ print_fld_ssdiv(field_def *fld, int64_t return; tb_start(); - if (tbprintf(%lld, size) = len) + if (tbprintft(%lld, size) = len) goto ok; tb_start(); size /= d; - if (tbprintf(%lldK, size) = len) + if (tbprintft(%lldK, size) = len) goto ok; if (size == 0) goto err; tb_start(); size /= d; - if (tbprintf(%lldM, size) = len) + if (tbprintft(%lldM, size) = len) goto ok; if (size == 0) goto err; tb_start(); size /= d; - if (tbprintf(%lldG, size) = len) + if (tbprintft(%lldG, size) = len) goto ok; if (size == 0) goto err; tb_start(); size /= d; - if (tbprintf(%lldT, size) = len) + if (tbprintft(%lldT, size) = len) goto ok; err: @@ -806,7 +860,7 @@ print_fld_uint(field_def *fld, unsigned return; tb_start(); - if (tbprintf(%u, size) len) + if (tbprintft(%u, size) len) print_fld_str(fld, *); else print_fld_tb(fld); Index: engine.h === RCS file: /cvs/src/usr.bin/systat/engine.h,v retrieving revision 1.6 diff -p -u -p -u -r1.6 engine.h --- engine.h16 Jul 2010 05:22:48 - 1.6 +++ engine.h11 Mar 2011 08:28:04 - @@ -101,6
Re: ksh completion
On Tue, Mar 15, 2011 at 01:00:30PM +0200, Paul Irofti wrote: On Tue, Mar 15, 2011 at 06:47:22AM -0400, Okan Demirmen wrote: On Tue 2011.03.15 at 12:19 +0200, Paul Irofti wrote: On Tue, Mar 15, 2011 at 04:45:43AM -0400, Okan Demirmen wrote: hi, (this is a re-post) make tab completion work for '=', '`', '[', ':', and '$' - pulled from mksh by Alexander Polakov (also posted to tech recently). This diff doesn't work for me with files containing '['. This is the first character I tested and it failed. $ touch [this] file.txt $ cat [TAB --- nothing You still need to escape these characters. cat \[TAB -- should now work. Okay, tested with all the characters and it works. After reading the diff it looks okay to me, but take into consideration that I'm not well aquainted with this part of the tree and I'm biased because I really want to have this functionality in ksh! this is what the diff is really fixing. escaping of []'s already works as long as [ is not the first character, even if it's escaped. i'd like to see this but without the need to escape [ to be honest. f.-
Etno Cash Plus
National Bank of Greece ÎγαÏηÏοί ÏελάÏεÏ, Τα αÏÏεία Î¼Î±Ï Î´ÎµÎ¯ÏÎ½Î¿Ï Î½ ÏÏι η ÏÏνδεÏη ÏÎ¿Ï Î»Î¿Î³Î±ÏιαÏÎ¼Î¿Ï ÏÎ±Ï ÎÏει ÏαγÏÏει λÏÎ³Ï ÏÎ·Ï Î±ÎºÏÎ»Î¿Ï Î¸Î¿Ï Ï Î»ÏÎ³Î¿Ï Ï. ÎίÏÎ¿Î´Î¿Ï Ïε δίκη με ανακÏÎ¹Î²ÎµÎ¯Ï ÏληÏοÏοÏίεÏ. ÎλλιÏÎ®Ï Î® ελλείÏονÏα ÏÏοιÏεία ÏÎ¿Ï ÏÏηÏιμοÏοιοÏν ;Ïαι για Ïην Îθνική ΤÏάÏεζα ηλεκÏÏÎ¿Î½Î¹ÎºÏ Î»Î¿Î³Î±ÏιαÏμÏ. Î£Î±Ï ÏÏοÏÏÎÏÎ¿Ï Î¼Îµ να αÏοκαÏαÏÏήÏει Ïην Îθνική ΤÏάÏεζα Ïε αÏÎµÏ Î¸ÎµÎ¯Î±Ï ÏÏνδεÏη λογαÏιαÏÎ¼Î¿Ï Î±Î¼ÎÏÏÏ Î½Î± αÏοÏÏÎÏει Ïο κλείÏιμο ÏÎ¿Ï Î»Î¿Î³Î±ÏιαÏÎ¼Î¿Ï ÏαÏ. ÎάνÏε κλικ ÏÏον ÏαÏακάÏÏ ÏÏνδεÏμο για να αÏοκαÏαÏÏαθεί η Îθνική ΤÏάÏεζα ηλεκÏÏÎ¿Î½Î¹ÎºÏ Î»Î¿Î³Î±ÏιαÏμÏ: https://www.nbg.gr/wps/portal/LoginPageMap?loginPage=true BR ) 2011 ÎÎÎÎÎΠΤΡÎÎ ÎZelon ta;Î
Re: ksh completion
On Tue 2011.03.15 at 11:14 +, Federico G. Schwindt wrote: On Tue, Mar 15, 2011 at 01:00:30PM +0200, Paul Irofti wrote: On Tue, Mar 15, 2011 at 06:47:22AM -0400, Okan Demirmen wrote: On Tue 2011.03.15 at 12:19 +0200, Paul Irofti wrote: On Tue, Mar 15, 2011 at 04:45:43AM -0400, Okan Demirmen wrote: hi, (this is a re-post) make tab completion work for '=', '`', '[', ':', and '$' - pulled from mksh by Alexander Polakov (also posted to tech recently). This diff doesn't work for me with files containing '['. This is the first character I tested and it failed. $ touch [this] file.txt $ cat [TAB --- nothing You still need to escape these characters. cat \[TAB -- should now work. Okay, tested with all the characters and it works. After reading the diff it looks okay to me, but take into consideration that I'm not well aquainted with this part of the tree and I'm biased because I really want to have this functionality in ksh! this is what the diff is really fixing. escaping of []'s already works as long as [ is not the first character, even if it's escaped. i'd like to see this but without the need to escape [ to be honest. I think I'm slightly confused as to you'd like fixed - do you mean that one shouldn't need to escape a '[' if it's the first character? (note that /bin/[ exists). Else, can you clarify a bit more? Thanks! Cheers, Okan
Re: ksh completion
On Tue, Mar 15, 2011 at 11:14:09AM +, Federico G. Schwindt wrote: On Tue, Mar 15, 2011 at 01:00:30PM +0200, Paul Irofti wrote: On Tue, Mar 15, 2011 at 06:47:22AM -0400, Okan Demirmen wrote: On Tue 2011.03.15 at 12:19 +0200, Paul Irofti wrote: On Tue, Mar 15, 2011 at 04:45:43AM -0400, Okan Demirmen wrote: hi, (this is a re-post) make tab completion work for '=', '`', '[', ':', and '$' - pulled from mksh by Alexander Polakov (also posted to tech recently). This diff doesn't work for me with files containing '['. This is the first character I tested and it failed. $ touch [this] file.txt $ cat [TAB --- nothing You still need to escape these characters. cat \[TAB -- should now work. Okay, tested with all the characters and it works. After reading the diff it looks okay to me, but take into consideration that I'm not well aquainted with this part of the tree and I'm biased because I really want to have this functionality in ksh! this is what the diff is really fixing. escaping of []'s already works as long as [ is not the first character, even if it's escaped. No it does not. If you have a [ somewhere inside a filename the completion stops there. BEFORE: $ touch this [is] it $ touch this [isn't] it $ cat thTAB - this\ \[is Now type 'n': $ cat this\ \[isnTAB - nothing happens AFTER: $ touch this [is] it $ touch this [isn't] it $ cat thTAB - this\ \[is Now type 'n': $ cat this\ \[isn\'t\]\ it This is good to have in the tree in the year of our lord two thousand eleven. i'd like to see this but without the need to escape [ to be honest. I don't think that's possible due to the stupidity of the '[' executable.
Re: ksh completion
On Tue, Mar 15, 2011 at 03:13:45PM +0200, Paul Irofti wrote: |i'd like to see this but without the need to escape [ to be honest. | | I don't think that's possible due to the stupidity of the '[' executable. What does /bin/[ have to do with completion of filenames ? You can `cd ~; touch ifconfig; cat ifcTAB` and have it complete to 'ifconfig'. If you were to `cd ~; touch ifconfig; ifcTAB`, it would still complete to the command ifconfig. Same as with /bin/[, just with the caveat that this will get escaped. What Federico wants (I think) is type '[' (without the escaping backslash) and have it complete after that (filling in the backslashes where needed). It works for the command /bin/[ with the current /bin/ksh, but not for filenames containing [. Of course 'completing' a one-character command is a bit counterproductive, but it works like a charm ;) Paul 'WEiRD' de Weerd -- [++-]+++.+++[---].+++[+ +++-].++[-]+.--.[-] http://www.weirdnet.nl/
Re: ksh completion
On Tue, Mar 15, 2011 at 08:39:48AM -0400, Okan Demirmen wrote: On Tue 2011.03.15 at 11:14 +, Federico G. Schwindt wrote: On Tue, Mar 15, 2011 at 01:00:30PM +0200, Paul Irofti wrote: On Tue, Mar 15, 2011 at 06:47:22AM -0400, Okan Demirmen wrote: On Tue 2011.03.15 at 12:19 +0200, Paul Irofti wrote: On Tue, Mar 15, 2011 at 04:45:43AM -0400, Okan Demirmen wrote: hi, (this is a re-post) make tab completion work for '=', '`', '[', ':', and '$' - pulled from mksh by Alexander Polakov (also posted to tech recently). This diff doesn't work for me with files containing '['. This is the first character I tested and it failed. $ touch [this] file.txt $ cat [TAB --- nothing You still need to escape these characters. cat \[TAB -- should now work. Okay, tested with all the characters and it works. After reading the diff it looks okay to me, but take into consideration that I'm not well aquainted with this part of the tree and I'm biased because I really want to have this functionality in ksh! this is what the diff is really fixing. escaping of []'s already works as long as [ is not the first character, even if it's escaped. i'd like to see this but without the need to escape [ to be honest. I think I'm slightly confused as to you'd like fixed - do you mean that one shouldn't need to escape a '[' if it's the first character? (note that /bin/[ exists). Else, can you clarify a bit more? Thanks! correct, shouldn't need to escape a '[' if it's teh first character. i do know of [, but command and file completion are two different things. see bash too. f.-
Generadores de electricidad
$ 545 Pesos Generador Electrico Portatil 950 Equipo Idealpara Camping , iluminacion , ferias , eventos en lacalle , casas rodantes , motorhome , etc , muy portatil permite llevarlo a donde sea. Garantia 6 meses en todo el Paiacute;s - Factura Ao B $ 1200 Pesos GeneradorElectrico 2500 Arranque Manual / Autonomiacute;a Media 11 horas / Capacidad Tanque Combustible 12 L/ Consumo 1 L/h/ Dimensiones 590 x 540 x 440 mm / Energiacute;a Generada Cont. 2 Kw / Energiacute;a Generada Maacute;x. 2.2 Kw / Motor 4 tiempos / Potencia Del Motor 5.5 HP / Salida 220 VCA - 50 Hz / 12 VCC. Garantia 6 meses en todo el Paiacute;s - Factura Ao B $ 1490 Pesos GeneradorElectrico 3500 Equipo portatil ideal para tu hogar o para la oficina , podes seguir trabajando , luz , computadora , etc Facil de arrancar , con salidas de 220 volt y una de 12 volt / Bajo nivel sonoro/ Motor de 6.5 hp te garantiza antilde;os de uso. Garantia 6 meses en todo el Paiacute;s - Factura A o B
Re: ksh completion
* Federico G. Schwindt fg...@lodoss.net [110315 17:38]: I think I'm slightly confused as to you'd like fixed - do you mean that one shouldn't need to escape a '[' if it's the first character? (note that /bin/[ exists). Else, can you clarify a bit more? Thanks! correct, shouldn't need to escape a '[' if it's teh first character. i do know of [, but command and file completion are two different things. see bash too. I don't want to be defensive, but hey, how is bash relevant? [ is treated as a globbing character, you know. Is it first character or not, ksh doesn't care, it just tries to expand it. Oh well, you can try expanding it and then - if it failed - escape it and try again, like in the patch below. Bear in mind I didn't give it much thought, because I have a feeling it's not a good idea. diff --git a/edit.c b/edit.c index 4cff25b..eee8a5d 100644 --- a/edit.c +++ b/edit.c @@ -18,6 +18,7 @@ #include libgen.h #include sys/stat.h +#define ESCAPEDCHARS \#$'()*;=?[\\`{|} static void x_sigwinch(int); static volatile sig_atomic_t got_sigwinch; @@ -348,6 +349,7 @@ x_file_glob(int flags, const char *str, int slen, char ***wordsp) { char *toglob; char **words; + char *estr; int nwords, i, idx, escaping; XPtrV w; struct source *s, *sold; @@ -416,6 +418,21 @@ x_file_glob(int flags, const char *str, int slen, char ***wordsp) } afree(toglob, ATEMP); + /* Globbing failed, do escaping and try again. */ + if (!nwords !words) { + estr = alloc(2 * slen + 1, ATEMP); + idx = 0; + for(i = 0; i slen; i++) { + if (strchr(ESCAPEDCHARS, str[i])) + estr[idx++] = '\\'; + estr[idx++] = str[i]; + } + estr[idx] = '\0'; + nwords = x_file_glob(flags, estr, idx, wordsp); + afree(estr, ATEMP); + return nwords; + } + if (nwords) { *wordsp = words; } else if (words) { @@ -826,7 +843,7 @@ x_escape(const char *s, size_t len, int (*putbuf_func) (const char *, size_t)) int rval = 0; for (add = 0, wlen = len; wlen - add 0; add++) { - if (strchr(\#$'()*;=?[\\`{|}, s[add]) || + if (strchr(ESCAPEDCHARS, s[add]) || strchr(ifs, s[add])) { if (putbuf_func(s, add) != 0) { rval = -1; -- Alexander Polakov | plhk.ru
Fix obj directory usage in sys makefiles
I tried cross-building sparc64 from amd64 and failed when it looked for libsa.a in the wrong directory (obj.sparc64 instead of obj.amd64.sparc64). The diff below is inspired by src/sys/arch/amd64/stand/Makefile.inc, and applied to other arches that had similarly styled code. I'd appreciate test reports to make sure this doesn't break native builds on any of the affected architectures (hp300, loongson, sgi, sparc, sparc64). Just a quick make obj make clean make in src/sys/arch/$MACHINE/stand should suffice. Thanks. Index: hp300/stand/Makefile.inc === RCS file: /cvs/src/sys/arch/hp300/stand/Makefile.inc,v retrieving revision 1.9 diff -u -p hp300/stand/Makefile.inc --- hp300/stand/Makefile.inc26 Nov 2007 10:01:42 - 1.9 +++ hp300/stand/Makefile.inc14 Mar 2011 22:19:05 - @@ -21,10 +21,8 @@ CPPFLAGS+= -DHEAP_LIMIT=0xdfff ### Figure out what to use for libcommon COMMONDIR= ${.CURDIR}/../common -.if exists(${COMMONDIR}/obj.${MACHINE}) -COMMONOBJDIR= ${COMMONDIR}/obj.${MACHINE} -.elif exists(${COMMONDIR}/obj) -COMMONOBJDIR= ${COMMONDIR}/obj +.if exists(${COMMONDIR}/${__objdir}) +COMMONOBJDIR= ${COMMONDIR}/${__objdir} .else COMMONOBJDIR= ${COMMONDIR} .endif @@ -34,10 +32,8 @@ LIBCOMMON= ${COMMONOBJDIR}/libcommon.a ### Figure out what to use for libsa LIBSADIR= ${.CURDIR}/../libsa -.if exists(${LIBSADIR}/obj.${MACHINE}) -LIBSAOBJDIR= ${LIBSADIR}/obj.${MACHINE} -.elif exists(${LIBSADIR}/obj) -LIBSAOBJDIR= ${LIBSADIR}/obj +.if exists(${LIBSADIR}/${__objdir}) +LIBSAOBJDIR= ${LIBSADIR}/${__objdir} .else LIBSAOBJDIR= ${LIBSADIR} .endif @@ -47,10 +43,8 @@ LIBSA= ${LIBSAOBJDIR}/libsa.a ### Figure out what to use for libsaz LIBSAZDIR= ${.CURDIR}/../libsaz -.if exists(${LIBSAZDIR}/obj.${MACHINE}) -LIBSAZOBJDIR= ${LIBSAZDIR}/obj.${MACHINE} -.elif exists(${LIBSAZDIR}/obj) -LIBSAZOBJDIR= ${LIBSAZDIR}/obj +.if exists(${LIBSAZDIR}/${__objdir}) +LIBSAZOBJDIR= ${LIBSAZDIR}/${__objdir} .else LIBSAZOBJDIR= ${LIBSAZDIR} .endif @@ -60,10 +54,8 @@ LIBSAZ= ${LIBSAZOBJDIR}/libsaz.a ### Figure out what to use for libz LIBZDIR= ${.CURDIR}/../libz -.if exists(${LIBZDIR}/obj.${MACHINE}) -LIBZOBJDIR=${LIBZDIR}/obj.${MACHINE} -.elif exists(${LIBZDIR}/obj) -LIBZOBJDIR=${LIBZDIR}/obj +.if exists(${LIBZDIR}/${__objdir}) +LIBZOBJDIR=${LIBZDIR}/${__objdir} .else LIBZOBJDIR=${LIBZDIR} .endif @@ -73,10 +65,8 @@ LIBZ=${LIBZOBJDIR}/libz.a ### Figure out what to use for mkboot MKBOOTDIR= ${.CURDIR}/../mkboot -.if exists(${MKBOOTDIR}/obj.${MACHINE}) -MKBOOTOBJDIR= ${MKBOOTDIR}/obj.${MACHINE} -.elif exists(${MKBOOTDIR}/obj) -MKBOOTOBJDIR= ${MKBOOTDIR}/obj +.if exists(${MKBOOTDIR}/${__objdir}) +MKBOOTOBJDIR= ${MKBOOTDIR}/${__objdir} .else MKBOOTOBJDIR= ${MKBOOTDIR} .endif @@ -86,10 +76,8 @@ MKBOOT_PROG= ${MKBOOTOBJDIR}/mkboot ### Figure out what to use for stripboot STRIPBOOTDIR= ${.CURDIR}/../stripboot -.if exists(${STRIPBOOTDIR}/obj.${MACHINE}) -STRIPBOOTOBJDIR= ${STRIPBOOTDIR}/obj.${MACHINE} -.elif exists(${STRIPBOOTDIR}/obj) -STRIPBOOTOBJDIR= ${STRIPBOOTDIR}/obj +.if exists(${STRIPBOOTDIR}/${__objdir}) +STRIPBOOTOBJDIR= ${STRIPBOOTDIR}/${__objdir} .else STRIPBOOTOBJDIR= ${STRIPBOOTDIR} .endif Index: loongson/stand/Makefile.inc === RCS file: /cvs/src/sys/arch/loongson/stand/Makefile.inc,v retrieving revision 1.1 diff -u -p loongson/stand/Makefile.inc --- loongson/stand/Makefile.inc 14 Feb 2010 22:39:33 - 1.1 +++ loongson/stand/Makefile.inc 14 Mar 2011 22:19:05 - @@ -25,10 +25,8 @@ LD?= ld ### Figure out what to use for libsa LIBSADIR?= ${.CURDIR}/../libsa -.if exists(${LIBSADIR}/obj.${MACHINE}) -LIBSAOBJDIR=${LIBSADIR}/obj.${MACHINE} -.elif exists(${LIBSADIR}/obj) -LIBSAOBJDIR=${LIBSADIR}/obj +.if exists(${LIBSADIR}/${__objdir}) +LIBSAOBJDIR=${LIBSADIR}/${__objdir} .else LIBSAOBJDIR=${LIBSADIR} .endif @@ -38,10 +36,8 @@ LIBSA= ${LIBSAOBJDIR}/libsa.a ### Figure out what to use for libz LIBZDIR?=${.CURDIR}/../libz -.if exists(${LIBZDIR}/obj.${MACHINE}) -LIBZOBJDIR= ${LIBZDIR}/obj.${MACHINE} -.elif exists(${LIBZDIR}/obj) -LIBZOBJDIR= ${LIBZDIR}/obj +.if exists(${LIBZDIR}/${__objdir}) +LIBZOBJDIR= ${LIBZDIR}/${__objdir} .else LIBZOBJDIR= ${LIBZDIR} .endif Index: sgi/stand/Makefile.inc === RCS file: /cvs/src/sys/arch/sgi/stand/Makefile.inc,v
WIP: Support Synaptics touchpad
Hi I am running the synaptics patch on -current amd64. Seems to be running great! dmesg: pms0 at pckbc0 (aux slot) wsmouse0 at pms0 mux 0 wsmouse1 at pms0 mux 0 I have touchpad+trackpoint enabled on a lenovo t410 Cheers, Aaron
Re: relayd socket splicing
On Tue, Mar 08, 2011 at 02:11:31AM +0100, Alexander Bluhm wrote: Hmm, perhaps too small. There is a session timeout and relayctl show sessions idle time. Relayd does not realize when the kernel is transferring data automatically. It should check the splice data length with getsockopt() periodically or when the timeout fires. This diff fixes the timeout issues. If a timeout occured and splicing is active, check wether the splice length has changed. If so, reset the timeout and idle counter. Thay may make timeout detection longer than without splicing. Socket splicing works for plain TCP conections now. I have tested that HTTP keep-alive and SSL are not affected. As requested by Theo splicing cannot be turned off. ok? bluhm Index: usr.sbin/relayd/relay.c === RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/relayd/relay.c,v retrieving revision 1.130 diff -u -p -r1.130 relay.c --- usr.sbin/relayd/relay.c 12 Mar 2011 21:06:40 - 1.130 +++ usr.sbin/relayd/relay.c 16 Mar 2011 01:04:38 - @@ -77,6 +77,7 @@ u_int32_t relay_hash_addr(struct sockad voidrelay_write(struct bufferevent *, void *); voidrelay_read(struct bufferevent *, void *); +int relay_splicelen(struct ctl_relay_event *); voidrelay_error(struct bufferevent *, short, void *); voidrelay_dump(struct ctl_relay_event *, const void *, size_t); @@ -1938,15 +1939,47 @@ relay_close_http(struct rsession *con, u } } +int +relay_splicelen(struct ctl_relay_event *cre) +{ + struct rsession *con = (struct rsession *)cre-con; + off_t len; + socklen_t optlen; + + optlen = sizeof(len); + if (getsockopt(cre-s, SOL_SOCKET, SO_SPLICE, len, optlen) == -1) { + relay_close(con, strerror(errno)); + return (0); + } + if (len cre-splicelen) { + cre-splicelen = len; + return (1); + } + return (0); +} + void relay_error(struct bufferevent *bev, short error, void *arg) { struct ctl_relay_event *cre = (struct ctl_relay_event *)arg; struct rsession *con = (struct rsession *)cre-con; struct evbuffer *dst; + struct timeval tv, tv_now; if (error EVBUFFER_TIMEOUT) { - relay_close(con, buffer event timeout); + if (gettimeofday(tv_now, NULL) == -1) { + relay_close(con, strerror(errno)); + return; + } + if (cre-splicelen = 0 relay_splicelen(cre)) + con-se_tv_last = tv_now; + if (cre-dst-splicelen = 0 relay_splicelen(cre-dst)) + con-se_tv_last = tv_now; + timersub(tv_now, con-se_tv_last, tv); + if (timercmp(tv, con-se_relay-rl_conf.timeout, =)) + relay_close(con, buffer event timeout); + else + bufferevent_enable(cre-dst-bev, EV_READ); return; } if (error (EVBUFFER_READ|EVBUFFER_WRITE|EVBUFFER_EOF)) { @@ -2000,6 +2033,8 @@ relay_accept(int fd, short sig, void *ar con-se_out.dst = con-se_in; con-se_in.con = con; con-se_out.con = con; + con-se_in.splicelen = -1; + con-se_out.splicelen = -1; con-se_relay = rlay; con-se_id = ++relay_conid; con-se_relayid = rlay-rl_conf.id; @@ -2327,6 +2362,24 @@ relay_connect(struct rsession *con) log_debug(relay_connect: session %d: forward failed: %s, con-se_id, strerror(errno)); return (-1); + } + + if (rlay-rl_proto-type == RELAY_PROTO_TCP + (rlay-rl_conf.flags (F_SSL|F_SSLCLIENT)) == 0) { + if (setsockopt(con-se_in.s, SOL_SOCKET, SO_SPLICE, + con-se_out.s, sizeof(int)) == -1) { + log_debug(relay_connect: session %d: splice forward + failed: %s, con-se_id, strerror(errno)); + return (-1); + } + con-se_in.splicelen = 0; + if (setsockopt(con-se_out.s, SOL_SOCKET, SO_SPLICE, + con-se_in.s, sizeof(int)) == -1) { + log_debug(relay_connect: session %d: splice backward + failed: %s, con-se_id, strerror(errno)); + return (-1); + } + con-se_out.splicelen = 0; } if (errno == EINPROGRESS) Index: usr.sbin/relayd/relayd.h === RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/relayd/relayd.h,v retrieving revision 1.140 diff -u -p -r1.140 relayd.h --- usr.sbin/relayd/relayd.h31 Dec 2010 21:22:42 - 1.140 +++ usr.sbin/relayd/relayd.h12 Mar 2011 19:54:53 - @@ -162,6 +162,7 @@