Re: svn commit: r274086 - head/sbin/route
On Tue, Nov 04, 2014 at 10:21:35AM +, Alexander V. Chernikov wrote: Author: melifaro Date: Tue Nov 4 10:21:34 2014 New Revision: 274086 URL: https://svnweb.freebsd.org/changeset/base/274086 Log: Put break after err() to please coverity. Reported by:Coverity CID:1250795 Shouldn't Coverity understand that err doesn't return? Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r273702 - head/tools/regression/lib/libc/nss
Author: stefanf Date: Sun Oct 26 17:56:58 2014 New Revision: 273702 URL: https://svnweb.freebsd.org/changeset/base/273702 Log: Remove incorrect semicolon. Modified: head/tools/regression/lib/libc/nss/test-gethostby.c Modified: head/tools/regression/lib/libc/nss/test-gethostby.c == --- head/tools/regression/lib/libc/nss/test-gethostby.c Sun Oct 26 17:56:47 2014(r273701) +++ head/tools/regression/lib/libc/nss/test-gethostby.c Sun Oct 26 17:56:58 2014(r273702) @@ -109,7 +109,7 @@ __gethostbyname2(const char *name, int a else { error = 0; he = getipnodebyname(name, af, ipnode_flags, error); - if (he == NULL); + if (he == NULL) errno = error; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r272894 - head/sys/dev/mc146818
On Fri, Oct 10, 2014 at 02:17:43PM +, Baptiste Daroussin wrote: Author: bapt Date: Fri Oct 10 14:17:42 2014 New Revision: 272894 URL: https://svnweb.freebsd.org/changeset/base/272894 Log: Use FreeBSD-bit-checking-style This appease gcc 4.9 issuing warnings about parentheses Differential Revision: https://reviews.freebsd.org/D933 Reviewed by:marius Modified: head/sys/dev/mc146818/mc146818.c Modified: head/sys/dev/mc146818/mc146818.c == --- head/sys/dev/mc146818/mc146818.c Fri Oct 10 12:38:53 2014 (r272893) +++ head/sys/dev/mc146818/mc146818.c Fri Oct 10 14:17:42 2014 (r272894) @@ -77,7 +77,7 @@ mc146818_attach(device_t dev) } mtx_lock_spin(sc-sc_mtx); - if (!(*sc-sc_mcread)(dev, MC_REGD) MC_REGD_VRT) { + if (((*sc-sc_mcread)(dev, MC_REGD) MC_REGD_VRT) == 0) { mtx_unlock_spin(sc-sc_mtx); device_printf(dev, %s: battery low\n, __func__); return (ENXIO); This changes the meaning. The old code was parsed as '(!...) MC_REGD_VRT' which evaluates to constant 0. Probably this was wrong, but your comment doesn't seem to indicate that. The other two changes are fine. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r272505 - in head/sys: kern sys
On Sat, Oct 04, 2014 at 02:21:54PM +, Bjoern A. Zeeb wrote: On 04 Oct 2014, at 08:08 , Mateusz Guzik m...@freebsd.org wrote: Author: mjg Date: Sat Oct 4 08:08:56 2014 New Revision: 272505 URL: https://svnweb.freebsd.org/changeset/base/272505 Log: Plug capability races. fp and appropriate capability lookups were not atomic, which could result in improper capabilities being checked. This could result either in protection bypass or in a spurious ENOTCAPABLE. Make fp + capability check atomic with the help of sequence counters. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h … This file is included from user space. There is no opt_capsicum.h there. Including an opt_* in the header file seems wrong in a lot of ways usually. I tried to add a bandaid for the moment with r272523 which (to be honest) makes it worse. This needs a better fix. Hi, this also breaks the nvidia-driver port (also with your fix). BR, Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r272505 - in head/sys: kern sys
On Sun, Oct 05, 2014 at 08:16:17PM +0300, Konstantin Belousov wrote: On Sun, Oct 05, 2014 at 06:39:54PM +0200, Stefan Farfeleder wrote: On Sat, Oct 04, 2014 at 02:21:54PM +, Bjoern A. Zeeb wrote: On 04 Oct 2014, at 08:08 , Mateusz Guzik m...@freebsd.org wrote: Author: mjg Date: Sat Oct 4 08:08:56 2014 New Revision: 272505 URL: https://svnweb.freebsd.org/changeset/base/272505 Log: Plug capability races. fp and appropriate capability lookups were not atomic, which could result in improper capabilities being checked. This could result either in protection bypass or in a spurious ENOTCAPABLE. Make fp + capability check atomic with the help of sequence counters. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h ??? This file is included from user space. There is no opt_capsicum.h there. Including an opt_* in the header file seems wrong in a lot of ways usually. I tried to add a bandaid for the moment with r272523 which (to be honest) makes it worse. This needs a better fix. Hi, this also breaks the nvidia-driver port (also with your fix). Is the breakage due to missing opt_capsicum.h file ? If yes, what I proposed, i.e. making the new member unconditional, should fix it without changes to the module build system. Yes, it breaks due to the missing file. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r269188 - head/sys/dev/vt
On Mon, Jul 28, 2014 at 02:22:34PM +, Aleksandr Rybalko wrote: Author: ray Date: Mon Jul 28 14:22:34 2014 New Revision: 269188 URL: http://svnweb.freebsd.org/changeset/base/269188 Log: Avoid embedding buffers into static virtual terminal window. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c == --- head/sys/dev/vt/vt_core.c Mon Jul 28 14:20:31 2014(r269187) +++ head/sys/dev/vt/vt_core.c Mon Jul 28 14:22:34 2014(r269188) @@ -166,8 +166,8 @@ static struct vt_window vt_conswindow = .vw_number = VT_CONSWINDOW, .vw_flags = VWF_CONSOLE, .vw_buf = { - .vb_buffer = vt_constextbuf, - .vb_rows = vt_constextbufrows, + .vb_buffer = vt_constextbuf[0], + .vb_rows = vt_constextbufrows[0], .vb_history_size = VBF_DEFAULT_HISTORY_SIZE, .vb_curroffset = 0, .vb_roffset = 0, Hi Aleksandr, What's that supposed to change exactly? I'd be very surprised if it didn't produce the same binary code. BR, Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl
Hi, On Sat, Jul 19, 2014 at 08:59:08PM +, Neel Natu wrote: Author: neel Date: Sat Jul 19 20:59:08 2014 New Revision: 268889 URL: http://svnweb.freebsd.org/changeset/base/268889 snip Modified: head/sys/amd64/vmm/intel/vmx.c == --- head/sys/amd64/vmm/intel/vmx.cSat Jul 19 20:55:13 2014 (r26) +++ head/sys/amd64/vmm/intel/vmx.cSat Jul 19 20:59:08 2014 (r268889) @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i { struct vm_exception exc; int vector, need_nmi_exiting, extint_pending; - uint64_t rflags; + uint64_t rflags, entryinfo; uint32_t gi, info; - if (vm_exception_pending(vmx-vm, vcpu, exc)) { - KASSERT(exc.vector = 0 exc.vector 32, - (%s: invalid exception vector %d, __func__, exc.vector)); + if (vm_entry_intinfo(vmx-vm, vcpu, entryinfo)) { + KASSERT((entryinfo VMCS_INTR_VALID) != 0, (%s: entry + intinfo is not valid: %#lx, __func__, entryinfo)); info = vmcs_read(VMCS_ENTRY_INTR_INFO); KASSERT((info VMCS_INTR_VALID) == 0, (%s: cannot inject pending exception %d: %#x, __func__, exc.vector, info)); /usr/src/sys/modules/vmm/../../amd64/vmm/intel/vmx.c:1214:22: error: unused variable 'exc' [-Werror,-Wunused-variable] struct vm_exception exc; ^ 1 error generated. Printing the uninitialised object in the KASSERT is most probably wrong. BR, Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r268869 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 cddl/dev/fbt
Hi, On Sat, Jul 19, 2014 at 02:27:32AM +, Mark Johnston wrote: Author: markj Date: Sat Jul 19 02:27:31 2014 New Revision: 268869 URL: http://svnweb.freebsd.org/changeset/base/268869 snip Modified: head/sys/amd64/amd64/trap.c == --- head/sys/amd64/amd64/trap.c Sat Jul 19 02:15:28 2014 (r268868) +++ head/sys/amd64/amd64/trap.c Sat Jul 19 02:27:31 2014 (r268869) @@ -97,7 +97,8 @@ PMC_SOFT_DEFINE( , , page_fault, write); #include sys/dtrace_bsd.h #endif -extern void trap(struct trapframe *frame); +extern void __noinline trap(struct trapframe *frame); +extern void trap_check(struct trapframe *frame); extern void syscall(struct trapframe *frame); void dblfault_handler(struct trapframe *frame); @@ -604,6 +605,19 @@ out: return; } +/* + * Ensure that we ignore any DTrace-induced faults. This function cannot + * be instrumented, so it cannot generate such faults itself. + */ +void +trap_check(struct trapframe *frame) +{ + + if (dtrace_trap_func != NULL (*dtrace_trap_func)(frame)) + return; + trap(frame); +} + static int /usr/src/sys/amd64/amd64/trap.c:616:6: error: use of undeclared identifier 'dtrace_trap_func' if (dtrace_trap_func != NULL (*dtrace_trap_func)(frame)) ^ This is without KDTRACE_HOOKS. BR, Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r268045 - in head/sys: amd64/conf i386/conf
On Mon, Jun 30, 2014 at 04:18:38PM +, Ed Maste wrote: Author: emaste Date: Mon Jun 30 16:18:38 2014 New Revision: 268045 URL: http://svnweb.freebsd.org/changeset/base/268045 Log: Add vt(4) to GENERIC and retire the separate VT config vt(4) and sc(4) can now coexist in the same kernel. To choose the vt driver, set the loader tunable kern.vty=vt . Hi Ed, I just added `device vt' to my kernel and set kern.vty=vt, but got no output at all upon rebooting. I tried setting hw.vga.textmode=1 as found in the man page but that didn't change anything. Only on the Wiki page I then found I need `device vt_vga' as well. With this it works for me now. In case it matters I have an nVidia graphic card and nvidia.ko loaded. Would it be possible to make this a runtime printf if missing? Or at least it should be added to vt(4) (there doesn't seem to be a man page for vt_vga) and maybe UPDATING. BR, Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r267675 - head/lib/libc/regex
On Fri, Jun 20, 2014 at 03:29:10PM +, Pedro F. Giffuni wrote: Author: pfg Date: Fri Jun 20 15:29:09 2014 New Revision: 267675 URL: http://svnweb.freebsd.org/changeset/base/267675 Log: regex: Make use of reallocf(). Use of reallocf is useful in libraries as we are not certain the application will exit after NULL. This somewhat reduces portability but if since you are building this as part of libc it is likely you have our non-standard reallocf(3) already. Reviewed by:ache MFC after: 5 days Modified: head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/regcomp.c == --- head/lib/libc/regex/regcomp.c Fri Jun 20 13:26:49 2014 (r267674) +++ head/lib/libc/regex/regcomp.c Fri Jun 20 15:29:09 2014 (r267675) @@ -,7 +,7 @@ allocset(struct parse *p) { cset *cs, *ncs; - ncs = realloc(p-g-sets, (p-g-ncsets + 1) * sizeof(*ncs)); + ncs = reallocf(p-g-sets, (p-g-ncsets + 1) * sizeof(*ncs)); if (ncs == NULL) { SETERROR(REG_ESPACE); return (NULL); @@ -1174,7 +1174,7 @@ CHadd(struct parse *p, cset *cs, wint_t if (ch NC) cs-bmp[ch 3] |= 1 (ch 7); else { - newwides = realloc(cs-wides, (cs-nwides + 1) * + newwides = reallocf(cs-wides, (cs-nwides + 1) * sizeof(*cs-wides)); if (newwides == NULL) { SETERROR(REG_ESPACE); Hi Pedro, I don't think these changes are OK. If reallocf() fails here, the cs-wides pointer will be freed and later freeset() will call free(cs-wides), probably crashing. The other cases are most probably similar though I haven't examined them closely. BR, Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r261801 - head/contrib/libc++/include
On Wed, Feb 12, 2014 at 06:14:50PM +, Dimitry Andric wrote: Author: dim Date: Wed Feb 12 18:14:49 2014 New Revision: 261801 URL: http://svnweb.freebsd.org/changeset/base/261801 Log: An ABI incompatibility crept into the libc++ 3.4 import in r261283. It was caused by upstream libc++ commit r194536, which aimed to make the headers more standards-compliant, by making std::pair's copy constructor trivial. Unfortunately, this could cause certain C++ applications using shared libraries built against the previous version of libc++ to crash. Fix the ABI incompatibility by making std::pair's copy constructor non-trivial again. Please note: Any C++ applications or shared libraries built with libc++ between r261283 and this revision should be recompiled. Thanks! ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r261283 - in head: contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src etc/mtree lib/libc++ sys/sys tools/build/mk
On Thu, Jan 30, 2014 at 07:44:23AM +, Dimitry Andric wrote: Author: dim Date: Thu Jan 30 07:44:22 2014 New Revision: 261283 URL: http://svnweb.freebsd.org/changeset/base/261283 Log: Import libc++ 3.4 release. This contains a lot of bugfixes, and some preliminary support for C++1y. MFC after: 3 weeks Hi Dimitry, Is this expected to change the ABI? I had to recompile the boost libraries to stop my applications from crashing. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r257133 - head/sys/dev/iwn
On Tue, Oct 29, 2013 at 10:17:18AM +0100, Stefan Farfeleder wrote: On Mon, Oct 28, 2013 at 09:27:30PM -0700, Adrian Chadd wrote: I've filed a PR. Please update to -HEAD and test. Ok thanks, will do. Probably I won't be able before tomorrow though. Seems to work as before, thanks! Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r257133 - head/sys/dev/iwn
On Mon, Oct 28, 2013 at 09:27:30PM -0700, Adrian Chadd wrote: I've filed a PR. Please update to -HEAD and test. Ok thanks, will do. Probably I won't be able before tomorrow though. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r257133 - head/sys/dev/iwn
On Mon, Oct 28, 2013 at 10:17:02AM -0700, Adrian Chadd wrote: Ping, any response? I'd like to narrow down what's going on here. Yeah, I'll have results soon, at the moment rebuilding my kernel. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r257133 - head/sys/dev/iwn
On Mon, Oct 28, 2013 at 10:17:02AM -0700, Adrian Chadd wrote: Ping, any response? I'd like to narrow down what's going on here. http://pastebin.com/veDsb0Xj Does this help in any way? Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r257133 - head/sys/dev/iwn
On Mon, Oct 28, 2013 at 12:07:17PM -0700, Adrian Chadd wrote: Yeah: Oct 28 19:43:43 mole kernel: iwn5000_tx_done: qid 3 idx 4 retries 7 nkill 0 rate a902 duration 686 status 83 status 0x83 is LONG_LIMIT, which meant it tried to transmit and it failed to get an ACK each time. The rate control says: 0x02: the rate in question bit 8: MCS bit 11: HT40 bits 14+15: transmit antennas A+B .. and it's an association/management frame, which is odd as they're not supposed to be sent as 11n HT40 frames like this. can you do the same experiment but with the patch reverted? I'd like to see what the selected rate is. Ok, here's the output with r257155 and r257133 reverted: http://pastebin.com/CJzsTANv Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r257133 - head/sys/dev/iwn
On Fri, Oct 25, 2013 at 07:44:54PM +, Adrian Chadd wrote: Author: adrian Date: Fri Oct 25 19:44:53 2013 New Revision: 257133 URL: http://svnweb.freebsd.org/changeset/base/257133 Log: Temporarily disable multi-rate retry (link quality) and eliminate rate index lookups. * My recent(ish) change to iwn(4) and the net80211 rate control API to support 11n rates broke the link quality table use. So, until I or someone else decides to fix it, let's just disable it for now. * Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function. * Eliminate two uses of the net80211 rate index lookup functions - they are only for legacy rates and they're not needed here. This fixes some invalid looking rate control TX issues that showed up on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look like DMA related issues. Tested: * 4965, STA mode * 5100, STA mode Hi Adrian, this change completely broke iwn for me. It's a iwn0: Intel WiFi Link 5100 mem 0xf1ffe000-0xf1ff irq 17 at device 0.0 on pci12 built-in device in a Dell Precision m4400. With this change, wpa_supplicant cannot associate any longer. In the logs I see every few seconds Oct 27 10:57:37 mole wpa_supplicant[2256]: wlan0: Trying to associate with xx:xx:xx:xx:xx:xx (SSID='xx' freq=2427 MHz) Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: Authentication with xx:xx:xx:xx:xx:xx timed out. Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1 If I revert just this revision based on a r257155 checkout, it works again. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r250806 - head/sys/sys
On Mon, May 20, 2013 at 01:06:50PM +0200, Ed Schouten wrote: Hi Stefan, 2013/5/19 Stefan Farfeleder stef...@freebsd.org: Shouldn't we fix lint and our headers to use a different macro name? One starting with __? Fixing lint: yes. Changing our macros to use a different name: no. The reason why we had __volatile, __inline, etc. in the first place, was because adding definitions for volatile and inline directly would be against the standard, as these words can be used freely in C99. C11 only added keywords starting with _[A-Z], which is reserved by all the older standards, meaning we are completely free to define them in any way we like. This specific breakage was unrelated to the naming of the keyword. The breakage existed, because existing tools do a build with -Dlint set. Because we use _Thread_local in our own header files already (runetype.h, I think), this caused a variable declared in a header file to be of the wrong kind (TLS vs non-TLS). In my opinion we should not add __[a-z] definitions for things that are part of C11. Doing this only makes our code less easily exportable to other systems. Hi Ed, I think you misunderstood what I meant. We now have quiet a few occurrences of `#ifdef lint' or equivalent in /usr/include. I think those should be changed to `#ifdef __lint' to allow application code to do #define lint foo #include header.h which is perfectly fine POSIX code (at least to my knowledge) and should not change the behaviour of the included header. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r250806 - head/sys/sys
On Tue, May 21, 2013 at 01:15:11AM +1000, Bruce Evans wrote: On Mon, 20 May 2013, Stefan Farfeleder wrote: I think you misunderstood what I meant. We now have quiet a few occurrences of `#ifdef lint' or equivalent in /usr/include. I think those should be changed to `#ifdef __lint' to allow application code to do #define lint foo #include header.h which is perfectly fine POSIX code (at least to my knowledge) and should not change the behaviour of the included header. lint actually predefines __LINT__, not __lint. __LINT__ is fine with me. I didn't bother to read lint's source, but the man page states: The lint utility runs the C preprocessor as its first phase, with the preprocessor symbol “lint” defined to allow certain questionable code to be altered or skipped by lint. Therefore, this symbol should be thought of as a reserved word for all code that is to be checked by lint. Of course it is a bug that system headers depend on symbols in the application namespace like lint. My version never had the lint ifdef(s) in sys/cdefs.h. I don't like them for other reasons. They results in lint checking different source code to what the compiler sees. FreeBSD's lint barely supports C90, but C99 features like C99 initializers are now used extensively, at least in the kernel. Use of features like this can't be hidden from lint using a few ifdefs in headers. Since nobody wants to update lint to recent C standards, maybe it's time to remove it? Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r250806 - head/sys/sys
On Sun, May 19, 2013 at 07:44:02AM +, Ed Schouten wrote: Author: ed Date: Sun May 19 07:44:01 2013 New Revision: 250806 URL: http://svnweb.freebsd.org/changeset/base/250806 Log: Remove lint case for _Thread_local. I added this block, knowing that lint does not support _Thread_local. When linting, we could argue that we don't care about TLS (yet). It seems, however, that external pieces of software also sometimes do a -Dlint, regex the output and compile it again. Shouldn't we fix lint and our headers to use a different macro name? One starting with __? Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r250242 - head/tools/regression/usr.bin/xargs
Author: stefanf Date: Sat May 4 16:41:14 2013 New Revision: 250242 URL: http://svnweb.freebsd.org/changeset/base/250242 Log: Add a few xargs tests related to -0, -n and quoting. Added: head/tools/regression/usr.bin/xargs/regress.0.in (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0I.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0J.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0L.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.n1.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.n2.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.n3.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.quotes.in (contents, props changed) head/tools/regression/usr.bin/xargs/regress.quotes.out (contents, props changed) Modified: head/tools/regression/usr.bin/xargs/regress.sh Added: head/tools/regression/usr.bin/xargs/regress.0.in == Binary file. No diff available. Added: head/tools/regression/usr.bin/xargs/regress.0.out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0.out Sat May 4 16:41:14 2013(r250242) @@ -0,0 +1,8 @@ +quick ' brown +fox jumped +over the lazy +dog +quick brown fox +jumped over the +lazy dog + Added: head/tools/regression/usr.bin/xargs/regress.0I.out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0I.out Sat May 4 16:41:14 2013(r250242) @@ -0,0 +1,18 @@ +The quick ' brown quick ' brownquick ' brown quick ' brown +The fox jumped +over the lazy fox jumped +over the lazyfox jumped +over the lazy fox jumped +over the lazy +The +The dog +quick brown fox dog +quick brown foxdog +quick brown fox dog +quick brown fox +The jumped over the jumped over thejumped over the jumped over the +The lazy dog + lazy dog +lazy dog + lazy dog + Added: head/tools/regression/usr.bin/xargs/regress.0J.out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0J.out Sat May 4 16:41:14 2013(r250242) @@ -0,0 +1,4 @@ +The quick ' brown fox jumped +over the lazy dog +quick brown fox jumped over the lazy dog + again. Added: head/tools/regression/usr.bin/xargs/regress.0L.out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0L.out Sat May 4 16:41:14 2013(r250242) @@ -0,0 +1,6 @@ +quick ' brown fox jumped +over the lazy +dog +quick brown fox +jumped over the lazy dog + Added: head/tools/regression/usr.bin/xargs/regress.n1.out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.n1.out Sat May 4 16:41:14 2013(r250242) @@ -0,0 +1,8 @@ +quick +brown +fox +jumped +over +the +lazy +dog Added: head/tools/regression/usr.bin/xargs/regress.n2.out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.n2.out Sat May 4 16:41:14 2013(r250242) @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the +lazy dog Added: head/tools/regression/usr.bin/xargs/regress.n3.out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.n3.out Sat May 4 16:41:14 2013(r250242) @@ -0,0 +1,3 @@ +quick brown fox +jumped over the +lazy dog Added: head/tools/regression/usr.bin/xargs/regress.quotes.in == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.quotes.in Sat May 4 16:41:14 2013(r250242) @@ -0,0 +1,4 @@ +a 'b c' \'d +e\ f g ' h +i\ +j Added: head/tools/regression/usr.bin/xargs/regress.quotes.out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.quotes.out Sat May 4 16:41:14 2013(r250242) @@ -0,0 +1,7
Re: svn commit: r249083 - in head: rescue/rescue sbin sbin/atacontrol share/man/man4 sys/amd64/conf sys/arm/conf sys/cam/ata sys/conf sys/dev/ata sys/dev/ata/chipsets sys/i386/conf sys/ia64/conf sys/m
On Thu, Apr 04, 2013 at 07:12:24AM +, Alexander Motin wrote: Author: mav Date: Thu Apr 4 07:12:24 2013 New Revision: 249083 URL: http://svnweb.freebsd.org/changeset/base/249083 Log: Remove all legacy ATA code parts, not used since options ATA_CAM enabled in most kernels before FreeBSD 9.0. Remove such modules and respective kernel options: atadisk, ataraid, atapicd, atapifd, atapist, atapicam. Remove the atacontrol utility and some man pages. Remove useless now options ATA_CAM. I think at least the removal of the ATA_CAM option should be worth a note in UPDATING. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r247014 - head/lib/libc/stdlib
On Wed, Feb 20, 2013 at 09:32:43AM +, David Chisnall wrote: On 20 Feb 2013, at 08:25, m...@freebsd.org wrote: These should be declared const int *. And the cast shouldn't be needed in C, since void * can be assigned to any other pointer type. In fact, the entire function body can be replaced with: return (*(int*)p1 - *(int*)p2); qsort doesn't require that you return -1, 0, or 1, it requires you return 0, 0, or 0. The subtraction might overflow and give wrong results. It won't for these specific elements, but it would be a bad example, IMHO. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r244604 - head/usr.sbin/gssd
On Sat, Dec 22, 2012 at 11:21:17PM +, Rick Macklem wrote: Author: rmacklem Date: Sat Dec 22 23:21:17 2012 New Revision: 244604 URL: http://svnweb.freebsd.org/changeset/base/244604 Log: It was reported via email that some sshds create kerberos credential cache files with names other than /tmp/krb5cc_uid. The gssd daemon does not know how to find these credential caches. This patch implements a new option -s that does a search for credential cache files, using roughly the same algorithm as the gssd daemon for Linux uses. The gssd behaviour is only changed if the new -s option is specified. It also implements two other new options related to the -s option. Reported by:Piete.Brooks at cl.cam.ac.uk, Herbert Poeckl Tested by: Herbert Poeckl (admin at ist.tugraz.at), Illias A. Marinos MFC after: 2 weeks Modified: head/usr.sbin/gssd/gssd.c I think you forgot to add -lkrb5 to the Makefile. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r241440 - in head: lib/libc/gen share/man/man5
Author: stefanf Date: Thu Oct 11 07:54:29 2012 New Revision: 241440 URL: http://svn.freebsd.org/changeset/base/241440 Log: Decode the first two fstab fields with strunvis(3). This allows having spaces in devices and mount paths, encoded as \s or \040. PR: bin/117687 Submitted by: Martin Kammerhofer Discussed on: arch Modified: head/lib/libc/gen/fstab.c head/share/man/man5/fstab.5 Modified: head/lib/libc/gen/fstab.c == --- head/lib/libc/gen/fstab.c Thu Oct 11 07:39:51 2012(r241439) +++ head/lib/libc/gen/fstab.c Thu Oct 11 07:54:29 2012(r241440) @@ -46,6 +46,7 @@ __FBSDID($FreeBSD$); #include stdlib.h #include string.h #include unistd.h +#include vis.h #include un-namespace.h static FILE *_fs_fp; @@ -149,11 +150,15 @@ fstabscan(void) /* OLD_STYLE_FSTAB */ while ((cp = strsep(p, \t\n)) != NULL *cp == '\0') ; + if (strunvis(cp, cp) 0) + goto bad; _fs_fstab.fs_spec = cp; if (!_fs_fstab.fs_spec || *_fs_fstab.fs_spec == '#') continue; while ((cp = strsep(p, \t\n)) != NULL *cp == '\0') ; + if (strunvis(cp, cp) 0) + goto bad; _fs_fstab.fs_file = cp; fixfsfile(); while ((cp = strsep(p, \t\n)) != NULL *cp == '\0') Modified: head/share/man/man5/fstab.5 == --- head/share/man/man5/fstab.5 Thu Oct 11 07:39:51 2012(r241439) +++ head/share/man/man5/fstab.5 Thu Oct 11 07:54:29 2012(r241440) @@ -32,7 +32,7 @@ .\ @(#)fstab.58.1 (Berkeley) 6/5/93 .\ $FreeBSD$ .\ -.Dd June 7, 2011 +.Dd October 11, 2012 .Dt FSTAB 5 .Os .Sh NAME @@ -66,12 +66,20 @@ The first field, .Pq Fa fs_spec , describes the special device or remote file system to be mounted. +The contents are decoded by the +.Xr strunvis 3 +function. +This allows using spaces or tabs in the device name which would be +interpreted as field separators otherwise. .Pp The second field, .Pq Fa fs_file , describes the mount point for the file system. For swap partitions, this field should be specified as .Dq none . +The contents are decoded by the +.Xr strunvis 3 +function, as above. .Pp The third field, .Pq Fa fs_vfstype , @@ -338,6 +346,7 @@ resides in .Xr mount 8 , .Xr quotacheck 8 , .Xr quotaon 8 , +.Xr strunvis 3 , .Xr swapon 8 , .Xr umount 8 .Sh HISTORY ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r241441 - head/lib/libc/gen
Author: stefanf Date: Thu Oct 11 08:18:28 2012 New Revision: 241441 URL: http://svn.freebsd.org/changeset/base/241441 Log: Fix my last commit. Only call strunvis after properly checking the argument is not NULL. Modified: head/lib/libc/gen/fstab.c Modified: head/lib/libc/gen/fstab.c == --- head/lib/libc/gen/fstab.c Thu Oct 11 07:54:29 2012(r241440) +++ head/lib/libc/gen/fstab.c Thu Oct 11 08:18:28 2012(r241441) @@ -150,16 +150,18 @@ fstabscan(void) /* OLD_STYLE_FSTAB */ while ((cp = strsep(p, \t\n)) != NULL *cp == '\0') ; - if (strunvis(cp, cp) 0) - goto bad; _fs_fstab.fs_spec = cp; - if (!_fs_fstab.fs_spec || *_fs_fstab.fs_spec == '#') + if (_fs_fstab.fs_spec == NULL || *_fs_fstab.fs_spec == '#') continue; + if (strunvis(_fs_fstab.fs_spec, _fs_fstab.fs_spec) 0) + goto bad; while ((cp = strsep(p, \t\n)) != NULL *cp == '\0') ; - if (strunvis(cp, cp) 0) - goto bad; _fs_fstab.fs_file = cp; + if (_fs_fstab.fs_file == NULL) + goto bad; + if (strunvis(_fs_fstab.fs_file, _fs_fstab.fs_file) 0) + goto bad; fixfsfile(); while ((cp = strsep(p, \t\n)) != NULL *cp == '\0') ; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r240156 - head/lib/libproc
On Thu, Sep 06, 2012 at 03:19:49AM +, Rui Paulo wrote: @@ -266,7 +268,11 @@ proc_addr2sym(struct proc_handle *p, uin if (addr = rsym addr = (rsym + sym.st_size)) { s = elf_strptr(e, dynsymstridx, sym.st_name); if (s) { - strlcpy(name, s, namesz); + if (strlen(s) 2 + s[0] == '_' s[1] == 'Z') + __cxa_demangle(s, name, namesz, NULL); + else + strlcpy(name, s, namesz); memcpy(symcopy, sym, sizeof(sym)); /* * DTrace expects the st_value to contain According to the documentation, __cxa_demangle will realloc the buffer if it is too small and return the new buffer. This case is not handled correctly. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r233700 - head/sys/kern
Hi, here are a few similar cases. Stefan Index: tools/regression/lib/libc/nss/test-gethostby.c === --- tools/regression/lib/libc/nss/test-gethostby.c (revision 233700) +++ tools/regression/lib/libc/nss/test-gethostby.c (working copy) @@ -109,7 +109,7 @@ else { error = 0; he = getipnodebyname(name, af, ipnode_flags, error); - if (he == NULL); + if (he == NULL) errno = error; } Index: cddl/compat/opensolaris/misc/deviceid.c === --- cddl/compat/opensolaris/misc/deviceid.c (revision 233700) +++ cddl/compat/opensolaris/misc/deviceid.c (working copy) @@ -45,7 +45,7 @@ return (EINVAL); } *retminor_name = strdup(); - if (*retminor_name == NULL); + if (*retminor_name == NULL) return (ENOMEM); return (0); } Index: sys/sparc64/pci/fire.c === --- sys/sparc64/pci/fire.c (revision 233700) +++ sys/sparc64/pci/fire.c (working copy) @@ -446,7 +446,7 @@ FO_PCI_TLU_CTRL_CFG_MASK) FO_PCI_TLU_CTRL_CFG_SHFT; i = sizeof(fire_freq_nak_tmr_thrs) / sizeof(*fire_freq_nak_tmr_thrs); - if (mps = i); + if (mps = i) mps = i - 1; FIRE_PCI_SET(sc, FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS, (fire_freq_nak_tmr_thrs[mps][lw] Index: sys/contrib/rdma/rdma_addr.c === --- sys/contrib/rdma/rdma_addr.c (revision 233700) +++ sys/contrib/rdma/rdma_addr.c (working copy) @@ -172,7 +172,7 @@ *dst = *dst_in; rtalloc(iproute); - if (iproute.ro_rt == NULL); + if (iproute.ro_rt == NULL) return; arpresolve(iproute.ro_rt-rt_ifp, iproute.ro_rt, NULL, Index: sys/dev/gpio/gpioc.c === --- sys/dev/gpio/gpioc.c (revision 233700) +++ sys/dev/gpio/gpioc.c (working copy) @@ -102,7 +102,7 @@ struct gpioc_softc *sc = device_get_softc(dev); int err; - if (sc-sc_ctl_dev); + if (sc-sc_ctl_dev) destroy_dev(sc-sc_ctl_dev); if ((err = bus_generic_detach(dev)) != 0) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r232857 - head/libexec/rtld-elf
On Mon, Mar 12, 2012 at 11:04:48AM +, Dimitry Andric wrote: Modified: head/libexec/rtld-elf/rtld.c == --- head/libexec/rtld-elf/rtld.c Mon Mar 12 10:36:03 2012 (r232856) +++ head/libexec/rtld-elf/rtld.c Mon Mar 12 11:04:48 2012 (r232857) @@ -1895,7 +1895,7 @@ preinit_main(void) int index; preinit_addr = (Elf_Addr *)obj_main-preinit_array; -if (preinit_addr == (Elf_Addr)NULL) +if (preinit_addr == (Elf_Addr *)NULL) return; for (index = 0; index obj_main-preinit_array_num; index++) { @@ -2036,7 +2036,7 @@ objlist_call_init(Objlist *list, RtldLoc call_initfini_pointer(elm-obj, elm-obj-init); } init_addr = (Elf_Addr *)elm-obj-init_array; - if (init_addr != (Elf_Addr)NULL) { + if (init_addr != (Elf_Addr *)NULL) { for (index = 0; index elm-obj-init_array_num; index++) { if (init_addr[index] != 0 init_addr[index] != 1) { dbg(calling init function for %s at %p, elm-obj-path, Why don't you simply remove the unnecessary casts? ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r230230 - head/sys/dev/random
On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote: On Thursday, January 26, 2012 10:56:27 am Andrey Chernov wrote: On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote: atomic_cmpset_int(iniseed_state, ARC4_ENTER_NONE, ARC4_ENTER_HAVE); break; Updated version (I hope, final): --- sys/libkern.h.old 2012-01-16 07:15:12.0 +0400 +++ sys/libkern.h 2012-01-26 19:38:06.0 +0400 @@ -72,6 +72,8 @@ static __inline quad_t qabs(quad_t a) { /* Prototypes for non-quad routines. */ struct malloc_type; +enum arc4_is { ARC4_ENTR_NONE, ARC4_ENTR_HAVE, ARC4_ENTR_DONE }; +extern volatile enum arc4_is arc4rand_iniseed_state; Atomics don't operate on enums. You'll need to make it an int and just use #define's for the 3 states. The type of an enumerator actually is `int', so it should be fine. uint32_t arc4random(void); voidarc4rand(void *ptr, u_int len, int reseed); int bcmp(const void *, const void *, size_t); --- dev/random/randomdev_soft.c.old 2011-03-02 01:42:19.0 +0300 +++ dev/random/randomdev_soft.c 2012-01-26 19:35:12.0 +0400 @@ -366,6 +366,8 @@ random_yarrow_unblock(void) selwakeuppri(random_systat.rsel, PUSER); wakeup(random_systat); } + (void)atomic_cmpset_int(arc4rand_iniseed_state, + ARC4_ENTR_NONE, ARC4_ENTR_HAVE); } Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r230230 - head/sys/dev/random
On Thu, Jan 26, 2012 at 06:34:13PM +0100, Stefan Farfeleder wrote: The type of an enumerator actually is `int', so it should be fine. Please ignore that, I misread the diff. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r230546 - head/usr.bin/bc
Author: stefanf Date: Wed Jan 25 18:49:11 2012 New Revision: 230546 URL: http://svn.freebsd.org/changeset/base/230546 Log: Remove extra sentence, a leftover from r202845. Modified: head/usr.bin/bc/bc.1 Modified: head/usr.bin/bc/bc.1 == --- head/usr.bin/bc/bc.1Wed Jan 25 18:36:01 2012(r230545) +++ head/usr.bin/bc/bc.1Wed Jan 25 18:49:11 2012(r230546) @@ -82,8 +82,6 @@ Prints usage information. Allow specification of an arbitrary precision math library. The definitions in the library are available to command line expressions. -Synonym for -.Fl l . .It Fl v , Fl Fl version Prints version information. .El ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r229075 - head/usr.sbin/bluetooth/hccontrol
Author: stefanf Date: Sat Dec 31 12:12:41 2011 New Revision: 229075 URL: http://svn.freebsd.org/changeset/base/229075 Log: Fix typos in command descriptions. Modified: head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Modified: head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c == --- head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.cSat Dec 31 11:43:35 2011(r229074) +++ head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.cSat Dec 31 12:12:41 2011(r229075) @@ -1633,7 +1633,7 @@ struct hci_commandhost_controller_baseb defines the amount of time for the duration of the page scan. \n \ The Page_Scan_Window can only be less than or equal to the Page_Scan_Interval.\n\n \ \tinterval - Range: 0x0012 -- 0x100, Time = N * 0.625 msec\n \ -\twindow - Range: 0x0012 -- 0x100, Time = N * 0.625 msen, +\twindow - Range: 0x0012 -- 0x100, Time = N * 0.625 msec, hci_write_page_scan_activity }, { @@ -1655,7 +1655,7 @@ struct hci_commandhost_controller_baseb parameter defines the amount of time for the duration of the inquiry scan.\n \ The Inquiry_Scan_Window can only be less than or equal to the Inquiry_Scan_Interval.\n\n \ \tinterval - Range: 0x0012 -- 0x100, Time = N * 0.625 msec\n \ -\twindow - Range: 0x0012 -- 0x100, Time = N * 0.625 msen, +\twindow - Range: 0x0012 -- 0x100, Time = N * 0.625 msec, hci_write_inquiry_scan_activity }, { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r228322 - in head: include lib/libc/stdlib sys/sys
On Wed, Dec 07, 2011 at 03:25:48PM +, David Chisnall wrote: /* + * If we're in a mode greater than C99, expose C1x functions. + */ +#if __ISO_C_VISIBLE 1999 +__noreturn void quick_exit(int) +int +at_quick_exit(void (*func)(void)); +#endif /* __ISO_C_VISIBLE 1999 */ +/* * Extensions made by POSIX relative to C. We don't know yet which edition Shouldn't it be visible in the default mode too (__BSD_VISIBLE)? ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r227487 - head/include
On Sun, Nov 13, 2011 at 04:18:48PM +, David Chisnall wrote: Author: theraven Date: Sun Nov 13 16:18:48 2011 New Revision: 227487 URL: http://svn.freebsd.org/changeset/base/227487 Log: The spec says that FILE must be defined in wchar.h, but it wasn't. It is now. Also hide some macros in C++ mode that will break C++ namespaced calls. Approved by:dim (mentor) I think this change is wrong. Whic spec are you referring to? C99 defines FILE only in 7.19.1#2 (stdio.h). In other headers FILE is used as parameter type for functions but that does not mean it is exported to user space. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r227369 - head/bin/sh
On Tue, Nov 08, 2011 at 11:54:39PM +, Jilles Tjoelker wrote: Author: jilles Date: Tue Nov 8 23:54:39 2011 New Revision: 227369 URL: http://svn.freebsd.org/changeset/base/227369 Log: sh: Remove undefined behaviour due to overflow in +/-/* in arithmetic. With i386 base gcc and i386 base clang, arith_yacc.o remains unchanged. Modified: head/bin/sh/arith_yacc.c Modified: head/bin/sh/arith_yacc.c == --- head/bin/sh/arith_yacc.c Tue Nov 8 23:44:26 2011(r227368) +++ head/bin/sh/arith_yacc.c Tue Nov 8 23:54:39 2011(r227369) @@ -131,11 +131,11 @@ static arith_t do_binop(int op, arith_t yyerror(divide error); return op == ARITH_REM ? a % b : a / b; case ARITH_MUL: - return a * b; + return (uintmax_t)a * (uintmax_t)b; case ARITH_ADD: - return a + b; + return (uintmax_t)a + (uintmax_t)b; case ARITH_SUB: - return a - b; + return (uintmax_t)a - (uintmax_t)b; case ARITH_LSHIFT: return a b; case ARITH_RSHIFT: Isn't the behaviour undefined too when you convert an out-of-range uintmax_t value back into an intmax_t value? Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226430 - head/contrib/gcc/config/i386
Author: stefanf Date: Sun Oct 16 10:14:33 2011 New Revision: 226430 URL: http://svn.freebsd.org/changeset/base/226430 Log: Adjust posix_memalign() prototype to match what we define in stdlib.h for C++ compilation. PR: standards/147210 Modified: head/contrib/gcc/config/i386/pmm_malloc.h Modified: head/contrib/gcc/config/i386/pmm_malloc.h == --- head/contrib/gcc/config/i386/pmm_malloc.h Sun Oct 16 10:00:28 2011 (r226429) +++ head/contrib/gcc/config/i386/pmm_malloc.h Sun Oct 16 10:14:33 2011 (r226430) @@ -34,7 +34,7 @@ #ifndef __cplusplus extern int posix_memalign (void **, size_t, size_t); #else -extern C int posix_memalign (void **, size_t, size_t) throw (); +extern C int posix_memalign (void **, size_t, size_t); #endif static __inline void * ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r223138 - head/sys/ufs/ffs
On Thu, Jun 16, 2011 at 05:26:03AM +, Tai-hwa Liang wrote: Author: avatar Date: Thu Jun 16 05:26:03 2011 New Revision: 223138 URL: http://svn.freebsd.org/changeset/base/223138 Log: Fixing compilation bustage by introducing another forward declaration. Modified: head/sys/ufs/ffs/ffs_extern.h Modified: head/sys/ufs/ffs/ffs_extern.h == --- head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 02:27:05 2011 (r223137) +++ head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 05:26:03 2011 (r223138) @@ -33,6 +33,7 @@ #ifndef _UFS_FFS_EXTERN_H #define _UFS_FFS_EXTERN_H +enum vtype; struct buf; struct cg; struct fid; This is not valid C code. For some reason GCC allows it (with our compilation flags). Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r221972 - head/sys/geom/part
On Sun, May 15, 2011 at 08:03:55PM +, Andrey V. Elsukov wrote: Author: ae Date: Sun May 15 20:03:54 2011 New Revision: 221972 URL: http://svn.freebsd.org/changeset/base/221972 Log: Add a sysctl kern.geom.part.check_integrity for those who has corrupt partition tables and lost an ability to boot after r221788. Also unhide an error message from bootverbose, this would help to easier determine the problem. So, what's the point of this check? It breaks mounting of all my USB drives. Everyone now has to set this sysctl? da0 at umass-sim0 bus 0 scbus6 target 0 lun 0 da0: Kingston DT 101 G2 PMAP Removable Direct Access SCSI-0 device da0: 40.000MB/s transfers da0: 15304MB (31342592 512 byte sectors: 255H 63S/T 1950C) GEOM_PART: integrity check failed (da0, MBR) Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219363 - head/bin/sh
Author: stefanf Date: Mon Mar 7 07:31:15 2011 New Revision: 219363 URL: http://svn.freebsd.org/changeset/base/219363 Log: Remove unnecessary cast. Reviewed by: jilles Modified: head/bin/sh/arith_yylex.c Modified: head/bin/sh/arith_yylex.c == --- head/bin/sh/arith_yylex.c Mon Mar 7 03:15:49 2011(r219362) +++ head/bin/sh/arith_yylex.c Mon Mar 7 07:31:15 2011(r219363) @@ -80,7 +80,7 @@ yylex() case '7': case '8': case '9': - yylval.val = strtoarith_t(buf, (char **)end, 0); + yylval.val = strtoarith_t(buf, end, 0); arith_buf = end; return ARITH_NUM; case 'A': ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r216616 - in head/sys: kern sys
On Tue, Dec 21, 2010 at 04:29:58PM +, Matthew D Fleming wrote: Author: mdf Date: Tue Dec 21 16:29:58 2010 New Revision: 216616 URL: http://svn.freebsd.org/changeset/base/216616 Log: Move the fail_point_entry definition from fail.h to kern_fail.c, which allows putting the enumeration constants of fail point types with the text string that matches them. [snip] +enum fail_point_t { + FAIL_POINT_OFF, /** don't fail */ + FAIL_POINT_PANIC, /** panic */ + FAIL_POINT_RETURN, /** return an errorcode */ + FAIL_POINT_BREAK, /** break into the debugger */ + FAIL_POINT_PRINT, /** print a message */ + FAIL_POINT_SLEEP, /** sleep for some msecs */ + FAIL_POINT_INVALID, /** placeholder */ +}; + +static const char *fail_type_strings[] = { + off, + panic, + return, + break, + print, + sleep, +}; FWIW, you can also do this in C99: static const char *fail_type_strings[] = { [FAIL_POINT_OFF] = off, }; Cheers, Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r213769 - head/sys/geom/part
On Wed, Oct 13, 2010 at 11:35:59AM +, Rui Paulo wrote: Author: rpaulo Date: Wed Oct 13 11:35:59 2010 New Revision: 213769 URL: http://svn.freebsd.org/changeset/base/213769 Log: The canonical way to print __func__ when using KASSERT() is to write (%s, __func__). This avoids clang's -Wformat-string warnings. That's a stupid warning, clang should know the value of __func__. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r212804 - head/sys/boot/zfs
Um, was the change from 32 to 31 deliberate? On Fri, Sep 17, 2010 at 10:51:45PM +, Pawel Jakub Dawidek wrote: Author: pjd Date: Fri Sep 17 22:51:45 2010 New Revision: 212804 URL: http://svn.freebsd.org/changeset/base/212804 Log: Remove magic value. Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c == --- head/sys/boot/zfs/zfs.c Fri Sep 17 22:05:27 2010(r212803) +++ head/sys/boot/zfs/zfs.c Fri Sep 17 22:51:45 2010(r212804) @@ -45,6 +45,8 @@ __FBSDID($FreeBSD$); #include zfsimpl.c +#define MAXBDDEV31 + static int zfs_open(const char *path, struct open_file *f); static int zfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); static int zfs_close(struct open_file *f); @@ -402,7 +404,7 @@ zfs_dev_init(void) * diskN, diskNpM or diskNsM. */ zfs_init(); - for (unit = 0; unit 32 /* XXX */; unit++) { + for (unit = 0; unit MAXBDDEV; unit++) { sprintf(devname, disk%d:, unit); fd = open(devname, O_RDONLY); if (fd == -1) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r211130 - head/libexec/rtld-elf/mips
On Tue, Aug 10, 2010 at 05:15:35AM +, Neel Natu wrote: Author: neel Date: Tue Aug 10 05:15:35 2010 New Revision: 211130 URL: http://svn.freebsd.org/changeset/base/211130 Log: Fix compilation error for 64-bit little endian build: libexec/rtld-elf/mips/reloc.c:196: warning: right shift count = width of type When the expression '(r_info) 32' was passed to bswap32() it was promptly changed to '(uint32_t)(r_info) 32' which is not what we intended. Wouldn't it be better to fix the bswap32 macro instead? Modified: head/libexec/rtld-elf/mips/reloc.c Modified: head/libexec/rtld-elf/mips/reloc.c == --- head/libexec/rtld-elf/mips/reloc.cMon Aug 9 23:32:37 2010 (r211129) +++ head/libexec/rtld-elf/mips/reloc.cTue Aug 10 05:15:35 2010 (r211130) @@ -75,7 +75,7 @@ void _rtld_relocate_nonplt_self(Elf_Dyn * ELF64 MIPS encodes the relocs uniquely. The first 32-bits of info contain * the symbol index. The top 32-bits contain three relocation types encoded * in big-endian integer with first relocation in LSB. This means for little - * endian we have to byte swap that interger (r_type). + * endian we have to byte swap that integer (r_type). */ #define Elf_Sxword Elf64_Sxword #define ELF_R_NXTTYPE_64_P(r_type) r_type) 8) 0xff) == R_TYPE(64)) @@ -83,7 +83,7 @@ void _rtld_relocate_nonplt_self(Elf_Dyn #undef ELF_R_SYM #undef ELF_R_TYPE #define ELF_R_SYM(r_info)((r_info) 0x) -#define ELF_R_TYPE(r_info) bswap32((r_info) 32) +#define ELF_R_TYPE(r_info) bswap32(((r_info) 32)) #endif #else #define ELF_R_NXTTYPE_64_P(r_type) (0) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r211130 - head/libexec/rtld-elf/mips
On Tue, Aug 10, 2010 at 12:55:38PM +0530, Jayachandran C. wrote: I think there is a problem in sys/mips/include/_endian.h -- #define __bswap16(x)(__uint16_t)(__is_constant(x) ? \ __bswap16_const((__uint16_t)x) : __bswap16_var((__uint16_t)x)) #define __bswap32(x)(__uint32_t)(__is_constant(x) ? \ __bswap32_const((__uint32_t)x) : __bswap32_var((__uint32_t)x)) #define __bswap64(x)(__uint64_t)(__is_constant(x) ? \ __bswap64_const((__uint64_t)x) : __bswap64_var((__uint64_t)x)) -- I'm not sure why the cast is needed, but we should have a braces around x, unless I'm completely mistaken. I agree. And around the entire expression too. Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r210941 - head/share/man/man9
Author: stefanf Date: Fri Aug 6 16:50:48 2010 New Revision: 210941 URL: http://svn.freebsd.org/changeset/base/210941 Log: Add links for destroy_dev_drain, destroy_dev_sched, destroy_dev_sched_cb, make_dev_cred and make_dev_credf. Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileFri Aug 6 15:59:00 2010 (r210940) +++ head/share/man/man9/MakefileFri Aug 6 16:50:48 2010 (r210941) @@ -769,8 +769,13 @@ MLINKS+=lock.9 lockdestroy.9 \ lock.9 lockstatus.9 MLINKS+=LOCK_PROFILING.9 MUTEX_PROFILING.9 MLINKS+=make_dev.9 destroy_dev.9 \ + make_dev.9 destroy_dev_drain.9 \ + make_dev.9 destroy_dev_sched.9 \ + make_dev.9 destroy_dev_sched_cb.9 \ make_dev.9 dev_depends.9 \ - make_dev.9 make_dev_alias.9 + make_dev.9 make_dev_alias.9 \ + make_dev.9 make_dev_cred.9 \ + make_dev.9 make_dev_credf.9 MLINKS+=malloc.9 free.9 \ malloc.9 MALLOC_DECLARE.9 \ malloc.9 MALLOC_DEFINE.9 \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r210498 - in head/sys: compat/freebsd32 sys
On Mon, Jul 26, 2010 at 12:52:45PM +, Konstantin Belousov wrote: Author: kib Date: Mon Jul 26 12:52:44 2010 New Revision: 210498 URL: http://svn.freebsd.org/changeset/base/210498 Log: Revert r210451, and the similar part of the r210431. The forward-declaration for the enum tag when enum definition is not complete is not allowed by C99, and is gcc extension. Requested by: stefanf MFC after: 28 days Thank you. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r210451 - head/sys/sys
Hi Konstantin, declaring enums like this is not standard C code (seems to be a GCC extension). I don't think we should use this feature in our headers. Stefan On Sat, Jul 24, 2010 at 06:14:34PM +, Konstantin Belousov wrote: Author: kib Date: Sat Jul 24 18:14:34 2010 New Revision: 210451 URL: http://svn.freebsd.org/changeset/base/210451 Log: Use forward declartion for enum uio_seg in imgact.h. This allows to remove inclusion of sys/uio.h from the header. Proposed by:alc MFC after: 1 week Modified: head/sys/sys/imgact.h Modified: head/sys/sys/imgact.h == --- head/sys/sys/imgact.h Sat Jul 24 18:05:10 2010(r210450) +++ head/sys/sys/imgact.h Sat Jul 24 18:14:34 2010(r210451) @@ -32,8 +32,6 @@ #ifndef _SYS_IMGACT_H_ #define _SYS_IMGACT_H_ -#include sys/uio.h - #define MAXSHELLCMDLEN PAGE_SIZE struct image_args { @@ -75,6 +73,7 @@ struct image_params { #ifdef _KERNEL struct sysentvec; struct thread; +enum uio_seg; #define IMGACT_CORE_COMPRESS 0x01 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r209119 - head/sys/sys
On Sun, Jun 13, 2010 at 01:59:11PM +, m...@freebsd.org wrote: (Relevant but almost a thread hijack): At Isilon we've run into a lot of problems with variable declarations in macros, especially with -Wshadow turned on. We ended up backporting __COUNTER__ from later versions of gcc and then using it to make unique variable names. - is the backport (or a fresh implementation) something that could be done within the scope of the GPL license? - is it something FreeBSD would be interested in? - is __COUNTER__ supported by clang? - if not, could it be? -Wshadow found several nasty bugs in our code, and apart from a few spurious warnings it has been handy to have when building our filesystem. In my opinion using non-standard C features just to work around warnings is a bit questionable. A more useful feature would be an attribute that avoids -Wshadow warnings. Regards, Stefan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org