move more code under UAUDIO_DEBUG

2018-08-20 Thread Michael W. Bombardieri
Hello, In uaudio_add_mixer() the number of input channels (ichs) is only used in a DPRINTF statement so the code to set its value can be excluded unless we're building a debug kernel. In my understanding uaudio_get_cluster_nchan() has no side effects. - Michael Index: uaudio.c

audio round_buffersize

2018-08-14 Thread Michael W. Bombardieri
Hello, Low level audio drivers using the upper layer audio driver's value for buffer size don't need to declare a round_buffersize method. The 3rd parameter of the method is the value provided by the upper layer driver which is used if round_buffersize isn't defined:

uaudio(4) division by zero patch

2018-08-07 Thread Michael W. Bombardieri
Hello, I adapted the following patch from netbsd to prevent a division by zero in the uaudio driver. http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/usb/uaudio.c.diff?r1=1.142=1.143=h I haven't encountered this problem with my own device but possibly it can be triggered by some device or by a

if_mue.c: loop -> memset

2018-08-02 Thread Michael W. Bombardieri
Hello, When reading over the mue(4) code I noticed that memset() can be used for clearing hashtbl. Also the switch case for IFM_100_TX was the same code as for IFM_1000_T so it can be rolled into one. - Michael Index: if_mue.c ===

uaudioctl() shadow variable 'error'

2018-07-31 Thread Michael W. Bombardieri
Hello, The function usbioctl() has an error variable and two more which are declared in nested blocks, i.e. switch cases for USB_REQUEST and USB_DEVICE_GET_FDESC. The following patch to remove the nested declarations builds cleanly, and if I'm following things correctly the function works the

remove uaudio_id_name()

2018-07-29 Thread Michael W. Bombardieri
Hello, The function uaudio_id_name() was used once for formatting a string and its return value was used to format a second string. By rolling the prepended letter "i" into the outer snprintf() the function can be removed entirely. Does this look correct? - Michael Index: uaudio.c

uaudio: simplify free() usage

2018-07-23 Thread Michael W. Bombardieri
Hello, A few NULL checks before free() can be removed in uaudio. Immediately freeing the value returned by uaudio_io_terminaltype() seems a little strange but I didn't look into that further. - Michael Index: uaudio.c === RCS

xhci typo in comment

2018-07-16 Thread Michael W. Bombardieri
Hello, When studying some usb code I noticed a couple of the comments didn't read well. Does this look better? - Michael Index: xhci.c === RCS file: /cvs/src/sys/dev/usb/xhci.c,v retrieving revision 1.86 diff -u -p -u -r1.86

Re: eoip(4): MikroTik Ethernet over IP support

2018-05-28 Thread Michael W. Bombardieri
On Sun, May 27, 2018 at 10:18:30AM +1000, David Gwynne wrote: > this implements MikroTiks Ethernet over IP protocol support. > > The Mikrotik protocol is basically GRE, so this is implemented as > eoip(4) as (yet another) part of if_gre. the main differences between > egre and eoip is that eoip

Re: switchd: bzero -> memset

2018-04-03 Thread Michael W. Bombardieri
On Tue, Apr 03, 2018 at 10:20:42PM -0600, Theo de Raadt wrote: > Michael W. Bombardieri <m...@ii.net> wrote: > > > Hello, > > > > switchd can just use memset instead of mixing memset with bzero. > > But does the util.c change need to be sync'ed with other tool

switchd: bzero -> memset

2018-04-03 Thread Michael W. Bombardieri
Hello, switchd can just use memset instead of mixing memset with bzero. But does the util.c change need to be sync'ed with other tools? - Michael Index: ofp10.c === RCS file: /cvs/src/usr.sbin/switchd/ofp10.c,v retrieving revision

azalia(4) debug

2018-03-20 Thread Michael W. Bombardieri
Hello, In azalia_set_params_sub() the cmode variable is only used by DPRINTF() so we can avoid declaring it when debugging is not enabled. - Michael Index: azalia.c === RCS file: /cvs/src/sys/dev/pci/azalia.c,v retrieving revision

ksh: __func__ in warnings

2018-03-13 Thread Michael W. Bombardieri
Hello, Some errors and warnings printed by ksh have the function name prefixed. __func__ could be used here instead of hard-coding the name. The names are wrong for tty_init(), j_set_async(), j_change(), x_file_glob() and c_ulimit() afaics. - Michael Index: c_ksh.c

remove goto in rdioctl()

2018-01-28 Thread Michael W. Bombardieri
Hello, Function rdioctl() uses a goto to leave the switch statement but a break would be enough. There is no other code to jump over (avoid) as with rdstrategy() which has goto bad and goto done. - Michael Index: rd.c === RCS

csh: calloc->malloc for new directory pointer

2018-01-14 Thread Michael W. Bombardieri
Hello, A fresh new 'struct directory' is allocated at three points in dir.c. This struct has four members: di_name, di_count, di_next and di_prev. For each instance all struct members are initialised immediately after the calloc(), so the new memory doesn't need to be cleared first. - Michael

Re: disabled code in ksh tree.c

2018-01-14 Thread Michael W. Bombardieri
On Sun, Jan 14, 2018 at 05:47:43PM +0100, Jeremie Courreges-Anglas wrote: > On Sun, Jan 14 2018, Anton Lindqvist <an...@openbsd.org> wrote: > > On Thu, Jan 11, 2018 at 03:25:15PM +0800, Michael W. Bombardieri wrote: > >> Hello, > >> > >> Revision 1.9 of

ksh: unused param in print_expansions()

2018-01-11 Thread Michael W. Bombardieri
Hello, The local function print_expansions() is a wrapper for x_print_expansions(). Going back to revision 1.1 of vi.c reveals the command parameter wasn't used then either. - Michael Index: vi.c === RCS file:

disabled code in ksh tree.c

2018-01-10 Thread Michael W. Bombardieri
Hello, Revision 1.9 of tree.c (from 1999) added the disabled code and it is still disabled. Would it be better to remove it? - Michael Index: tree.c === RCS file: /cvs/src/bin/ksh/tree.c,v retrieving revision 1.30 diff -u -p -u

azalia_free_dmamem()

2018-01-08 Thread Michael W. Bombardieri
Hello, This free function in azalia driver can be converted to void because it has nothing useful to return. The old return value was never used. azalia's other free function azalia_freem() is already void. - Michael Index: azalia.c

ifdef bwfm_pci_debug_console()

2018-01-07 Thread Michael W. Bombardieri
Hello, I noticed that calls to the function bwfm_pci_debug_console() are wrapped in ifdef but the function itself isn't. - Michael Index: if_bwfm_pci.c === RCS file: /cvs/src/sys/dev/pci/if_bwfm_pci.c,v retrieving revision 1.8

yacc print_grammar(): loop -> fprintf()

2018-01-03 Thread Michael W. Bombardieri
Hello, In yacc the function print_grammar() writes the file y.output if the -v option is used. fprintf() can be used directly for writing "spacing" space characters of indentation so a loop can be removed. - Michael Index: reader.c

size for free() in if_bwfm_pci.c

2018-01-02 Thread Michael W. Bombardieri
Hello, In bwfm_pci_dmamem_alloc() and bwfm_pci_dmamem_free(), bdm points to a single struct not an array. When freeing it we can just use the struct size. Does this look correct? - Michael Index: if_bwfm_pci.c === RCS file:

make: guard condition in shortened_curdir()

2017-12-19 Thread Michael W. Bombardieri
Hello, make(1) has a guard in shortened_curdir() so Buf_Init() should only happen once. I think this is desirable because Buf_Init() malloc's space and old storage pointers could be overwritten. The guard doesn't work as intended because 'first' is always true. - Michael Index: job.c

one XXX in ksh(1)

2017-12-17 Thread Michael W. Bombardieri
Hello, In my understanding the reason why texec had to be static was because the struct member ioact was never initialised. The call tree is execute() -> comexec() -> exchild() -> execute() and a fork happens in exchild(). The second execute() dereferences t->ioact on line 115 which causes SEGV.

csh dounsetenv()

2017-12-17 Thread Michael W. Bombardieri
Hello, The free() at the top of dounsetenv() in csh(1) isn't needed because name is always freed before returning at bottom of function. Also, name itself is never returned so it doesn't need to be static. ./csh setenv HEY YU unsetenv HEY printenv I ran the above and it seems to work the same

csh: NULL checks before free()

2017-12-15 Thread Michael W. Bombardieri
Hello, Previously in csh(1) the xfree() function was removed in favour of regular free(). This patch removes a couple of NULL checks before free(). - Michael PS: Thanks for putting hostname in the default prompt! Index: csh.c ===

dc: strdup -> bstrdup

2017-12-06 Thread Michael W. Bombardieri
Hello, Mostly dc(1) uses its own bstrdup() which exits on error. It can be used in two more places. - Michael Index: dc.c === RCS file: /cvs/src/usr.bin/dc/dc.c,v retrieving revision 1.19 diff -u -p -u -r1.19 dc.c --- dc.c

lex: simplify PRINT_SPACES() macro

2017-11-29 Thread Michael W. Bombardieri
Hello, Upstream flex converted macro PRINT_SPACES() into a single fprintf() call. https://github.com/westes/flex/commit/37a6184dabcd82fa1d17c24c000f3da469296195#diff-25d902c24283ab8cfbac54dfa101ad31 Applying this to OpenBSD lex reduces the differences in scanopt.c between the two. - Michael

cvsweb: cvs annotate error

2017-11-21 Thread Michael W. Bombardieri
Hello, Sorry if this is the wrong list, but I found a couple of branch revisions in file src/sys/dev/midi.c which produce an error when clicking "annotate" link in cvsweb. http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/dev/midi.c?annotate=1.40.6.1

ehci_alloc_itd_chain() tweak

2017-11-21 Thread Michael W. Bombardieri
Hello, In ehci_alloc_itd_chain(), no need to compute uframes if nframes is zero and function would return early. - Michael Index: src/sys/dev/usb/ehci.c === RCS file: /cvs/src/sys/dev/usb/ehci.c,v retrieving revision 1.200 diff -u

Re: yacc: malloc+copy -> strndup()

2017-11-03 Thread Michael W. Bombardieri
On Fri, Nov 03, 2017 at 09:29:16AM +0100, Otto Moerbeek wrote: > On Fri, Nov 03, 2017 at 04:22:43PM +0800, Michael W. Bombardieri wrote: > > > On Fri, Nov 03, 2017 at 04:03:44PM +0800, Michael W. Bombardieri wrote: > > > Hello, > > > > > > In yacc the d

Re: yacc: malloc+copy -> strndup()

2017-11-03 Thread Michael W. Bombardieri
On Fri, Nov 03, 2017 at 04:03:44PM +0800, Michael W. Bombardieri wrote: > Hello, > > In yacc the dup_line() function malloc()'ed a buffer and copied > a line into it. The copied line includes \n. > Allocate-and-copy can be done by strndup() in one hit. > I ran this on i386

yacc: malloc+copy -> strndup()

2017-11-03 Thread Michael W. Bombardieri
Hello, In yacc the dup_line() function malloc()'ed a buffer and copied a line into it. The copied line includes \n. Allocate-and-copy can be done by strndup() in one hit. I ran this on i386 with awk/awkgram.y and rcs/date.y and didn't see any difference in y.tab.c compared to the system's yacc.

makefs: malloc -> emalloc

2017-10-31 Thread Michael W. Bombardieri
Hello, makefs has an xmalloc.c with emalloc() function, but one thing was still using malloc() directly. This patch makes malloc() always happen through emalloc(). - Michael Index: msdos/mkfs_msdos.c === RCS file:

Re: makefs(8): add EFI platform-id for UFI

2017-10-30 Thread Michael W. Bombardieri
On Mon, Oct 30, 2017 at 05:27:29PM +0900, YASUOKA Masahiko wrote: > Hi, > > I'd like to add a platform-id for EFI boot. > > ok? > > diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.c > b/usr.sbin/makefs/cd9660/cd9660_eltorito.c > index 46ec432bc84..376c42f5dc3 100644 > ---

Re: cdio: read_track: plug leak

2017-09-10 Thread Michael W. Bombardieri
Hi, Patch was also posted here, but I didn't test it. https://marc.info/?l=openbsd-tech=149784342025304=2 - Michael On Sun, Sep 10, 2017 at 04:23:49PM -0500, Scott Cheloha wrote: > Hi, > > Saw this when preparing the monotonic clock patch. > > This is a leak, right? Every other return path

Re: awk fpecatch() update

2017-09-05 Thread Michael W. Bombardieri
On Tue, Sep 05, 2017 at 01:27:31PM +0800, Michael W. Bombardieri wrote: > Hello, > > Updated version of awk (Dec 20, 2012) [1] has a simplification > in fpecatch() function. I tried to test this to compare the > error output. Oops, I failed to notice it was a local change fr

awk fpecatch() update

2017-09-04 Thread Michael W. Bombardieri
Hello, Updated version of awk (Dec 20, 2012) [1] has a simplification in fpecatch() function. I tried to test this to compare the error output. Old version: $ /usr/bin/awk '{}' *** receive SIGFPE via kill(1) *** floating point exception source line number 1 New version: $ ./awk '{}' ***

align struct rcs_num between cvs(1) and rcs(1)

2017-09-04 Thread Michael W. Bombardieri
Hi, The struct rcs_num in rcs(1) had a pointer for rn_id, but the version in cvs(1) had an array of size RCSNUM_MAX. This patch tries to make rcs(1) follow cvs(1) here, so rn_id doesn't need to be freed. As a result the rcsnum_free() function is replaced by one free(). After applying this patch

sendbug categories

2017-09-04 Thread Michael W. Bombardieri
Hello, Are sparc and vax still considered valid categories for sendbug or should people now use only sparc64? - Michael Index: sendbug.c === RCS file: /cvs/src/usr.bin/sendbug/sendbug.c,v retrieving revision 1.78 diff -u -p -u

Re: lex: action_m4_define

2017-09-04 Thread Michael W. Bombardieri
I forgot to mention that action_m4_define() was previously removed from upstream flex here: https://github.com/westes/flex/commit/925549475edb3c8921227fdd96aa0d90a2c0745a On Sun, Aug 27, 2017 at 06:41:31PM +0800, Michael W. Bombardieri wrote: > Hello, > > In lex(1) the function action_

lex: unused variable

2017-08-27 Thread Michael W. Bombardieri
Hello, I spotted an unused variable (r) in filter_apply_chain() function of lex(1). - Michael Index: filter.c === RCS file: /cvs/src/usr.bin/lex/filter.c,v retrieving revision 1.8 diff -u -p -u -r1.8 filter.c --- filter.c17

lex: action_m4_define

2017-08-27 Thread Michael W. Bombardieri
Hello, In lex(1) the function action_m4_define() would raise a fatal error if called. I couldn't see anything calling it though, and the program builds without it. - Michael Index: misc.c === RCS file:

make: setenv or esetenv

2017-08-21 Thread Michael W. Bombardieri
Hi, In make(1), setenv() was mostly called through a wrapper function esetenv() which exits on error. When setting MAKEBASEDIRECTORY the return value of setenv() was not checked. Converting the call to esetenv() makes it more consistent. The third param of setenv(), overwrite, doesn't matter

lex: malloc+memset -> calloc

2017-08-16 Thread Michael W. Bombardieri
Hello, Two instances of memset() can be removed in lex if calloc() is used instead of malloc(). - Michael Index: filter.c === RCS file: /cvs/src/usr.bin/lex/filter.c,v retrieving revision 1.7 diff -u -p -u -r1.7 filter.c ---

make: clarify an error string

2017-07-24 Thread Michael W. Bombardieri
Hi, In make(1), do_run_command() has a sanity check for a null command string. The error message passes the null string to printf(). Is this any better? - Michael Index: engine.c === RCS file: /cvs/src/usr.bin/make/engine.c,v

make: efree/free

2017-07-23 Thread Michael W. Bombardieri
Hi, Some parts of make(1) use free() and others use efree() but efree is just a define for free. Remove efree? - Michael Index: arch.c === RCS file: /cvs/src/usr.bin/make/arch.c,v retrieving revision 1.88 diff -u -p -u -r1.88

warning when building make(1)

2017-07-10 Thread Michael W. Bombardieri
Hi, The function build_target_group() produces two warnings when make is built with CDIAGFLAGS. parse.c:1462: warning: ISO C90 forbids mixed declarations and code parse.c:1462: warning: 'gn2' may be used uninitialized in this function This patch attempts to silence the warnings. - Michael

bc makefile tweak

2017-07-03 Thread Michael W. Bombardieri
Hi, When building bc, yacc can directly write bc.c instead of renaming the file with mv. Does this look any better? - Michael Index: Makefile === RCS file: /cvs/src/usr.bin/bc/Makefile,v retrieving revision 1.9 diff -u -p -u -r1.9

cdio read_track() malloc/free

2017-06-18 Thread Michael W. Bombardieri
Hello, In cdio's read_track() the error condition around sio_write() doesn't free local storage "sec" before it returns. The other error cases appear to free it. - Michael Index: rip.c === RCS file: /cvs/src/usr.bin/cdio/rip.c,v

lex scanopt_destroy()

2017-05-30 Thread Michael W. Bombardieri
Hi, In lex the return value of scanopt_destroy() is never used. This function is a wrapper for free(), and free() has no value to return. - Michael Index: scanopt.c === RCS file: /cvs/src/usr.bin/lex/scanopt.c,v retrieving

Re: uaudio_drain() not needed?

2017-04-29 Thread Michael W. Bombardieri
On Mon, Apr 24, 2017 at 08:29:17AM +0200, Alexandre Ratchov wrote: > On Mon, Apr 24, 2017 at 01:04:12AM +0800, Michael W. Bombardieri wrote: > > Hi, > > > > When I remove uaudio_drain() on my laptop the attach/detach still > > seems to work as expected. > > I d

Re: marco's plaintext history patch

2017-04-28 Thread Michael W. Bombardieri
On Fri, Apr 28, 2017 at 10:01:06AM +0200, Theo Buehler wrote: > This is an updated version of an old patch by marco [1], including some > improvements and fixes by natano and me. Here's marco's description: > > > I have had enough of corrupt ksh history so I had a look at the code to > > try to

vi: cs_next() return value

2017-04-26 Thread Michael W. Bombardieri
Hello, In vi, cs_next() always returns zero so don't check its return value. cs.cs_flags is always checked afterwards; cs.cs_flags seems to be the effective return value. I didn't change two invocations in v_word.c where cs_next() is 2nd operand in && expression and might be skipped. - Michael

uaudio_drain() not needed?

2017-04-23 Thread Michael W. Bombardieri
Hi, When I remove uaudio_drain() on my laptop the attach/detach still seems to work as expected. I did a test with two usb soundcards. Audio files were played & recorded using aucat. * boot system (no audio device because I disabled azalia) * attach device1 (Creative card) * play wav file1

make.1 spellcheck

2017-04-19 Thread Michael W. Bombardieri
Hi, Spellchecker found two non-dictionary words in the make(1) manual. - Michael Index: make.1 === RCS file: /cvs/src/usr.bin/make/make.1,v retrieving revision 1.124 diff -u -p -u -r1.124 make.1 --- make.1 1 Jan 2017 01:08:11

vi unused variables

2017-04-18 Thread Michael W. Bombardieri
Hi, Some unused variables in vi were identified by gcc 4.9.4. - Michael Index: common/recover.c === RCS file: /cvs/src/usr.bin/vi/common/recover.c,v retrieving revision 1.25 diff -u -p -u -r1.25 recover.c --- common/recover.c

vscsi_t2i() unused variable

2017-04-17 Thread Michael W. Bombardieri
Hello, The variable rv in vscsi_t2i() appears to always be zero and could be removed. - Michael Index: src/sys/dev/vscsi.c === RCS file: /cvs/src/sys/dev/vscsi.c,v retrieving revision 1.41 diff -u -p -u -r1.41 vscsi.c ---

vi NULL check before free()

2017-04-16 Thread Michael W. Bombardieri
Hi, Remove some checks for NULL around free() in vi. vi still sees to work when I build it on i386 and amd64. - Michael Index: cl/cl_screen.c === RCS file: /cvs/src/usr.bin/vi/cl/cl_screen.c,v retrieving revision 1.27 diff -u -p

yacc: y.tab.c remains on error

2017-04-16 Thread Michael W. Bombardieri
Hi, yacc will produce a y.tab.c file when it is fed input with bad syntax. Maybe this is expected behaviour but is it better for yacc to clean up after itself? When I feed the same badsyntax.y to bison 3.0.4 it doesn't create y.tab.c. yacc creates y.tab.c very early. Unlink the file in done() if

vmm/amd64 __func__

2017-04-14 Thread Michael W. Bombardieri
Hi, This patch is a continuation of https://marc.info/?l=openbsd-tech=149214401819485=2 * Make __func__ usage more consistent in vmm/amd64 * Typo cant->can't in the following error messages... vcpu_run_vmx: cant read exit reason vmm_get_exit_qualification: cant extract exit qual * One

vmm/i386 __func__

2017-04-13 Thread Michael W. Bombardieri
Hi, Some printf() statements in vmm.c already used __func__ but some didn't. This diff adds more __func__. Also, one printf() statement was missing a space: "vcpu_run_vmx: can't readprocbased ctls on exit" - Michael Index: vmm.c

Re: vmm/i386 VMM_DEBUG

2017-04-11 Thread Michael W. Bombardieri
Works for me here. On Tue, Apr 11, 2017 at 09:35:13PM -0700, Philip Guenther wrote: > On Wed, 12 Apr 2017, Michael W. Bombardieri wrote: > > Building with VMM_DEBUG enabled failed because a printf() warning was > > treated as an error. > ... > > DP

vmm/i386 VMM_DEBUG

2017-04-11 Thread Michael W. Bombardieri
Hi, Building with VMM_DEBUG enabled failed because a printf() warning was treated as an error. - Michael cc1: warnings being treated as errors /usr/src/src/sys/arch/i386/i386/vmm.c: In function 'vmm_handle_cpuid': /usr/src/src/sys/arch/i386/i386/vmm.c:4355: warning: format '%llx' expects type

clean up disabled 386 code

2017-04-05 Thread Michael W. Bombardieri
Hi, The code in "#if 0" has been disabled since revision 1.1. >From what I see netbsd removed it too: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/i386/i386/trap.c.diff?r1=1.237=1.238=date_with_tag=MAIN=h - Michael Index: src/sys/arch/i386/i386/trap.c

usage() in chpass(1)

2017-03-31 Thread Michael W. Bombardieri
Hi, The following patch makes chpass(1) fail even faster when the wrong options are provided and usage() would be printed. In other words, no point accessing environment variables before checking result of getopt(). - Michael Index: chpass.c

softraid_crypto.c malloc failure case

2017-01-16 Thread Michael W. Bombardieri
Hi, In sr_crypto_change_maskkey() p was being checked for NULL twice, once after malloc() and once at goto label. I think malloc() failure would be the only case where p doesn't need to be freed, so add a special goto label for this. Sorry if I got it wrong. - Michael Index: softraid_crypto.c

sys/malloc.h in sys/dev/usb

2017-01-08 Thread Michael W. Bombardieri
Hi, Some usb drivers don't appear to need malloc(). I recently found this for umidi_quirks.c and decided to look further. The patch was built on i386. - Michael Index: if_urtw.c === RCS file: /cvs/src/sys/dev/usb/if_urtw.c,v

yacc: loop -> memcpy

2017-01-05 Thread Michael W. Bombardieri
Hi, Two loops in yacc/lalr.c can be converted into memcpy(). I quickly tested this on i386 and amd64 against rcs/date.y and the output matched y.tab.c of unpatched yacc. - Michael Index: lalr.c === RCS file:

const in crypto code

2017-01-03 Thread Michael W. Bombardieri
Hi, Add "const" to weak_keys array which is read only (read via bcmp()). >From what I see all other arrays in src/sys/crypto are already "static const". - Michael Index: set_key.c === RCS file: /cvs/src/sys/crypto/set_key.c,v

uaudio: preliminary patch for yamaha ur12 device support

2017-01-03 Thread Michael W. Bombardieri
Hi, Sending this patch to tech@ in case people have usb audio devices to test it. When connecting yamaha ur12 usb audio interface I was getting USBD_INVAL because of the aclen check. netbsd previously removed the check for aclen here:

dev/rnd.c more explicit_bzero

2016-12-12 Thread Michael W. Bombardieri
Hi, Some functions in rnd have a timespec; make sure to zero it as already done with other buffers. Also do buf in dequeue_randomness(). - Michael Index: src/sys/dev/rnd.c === RCS file: /cvs/src/sys/dev/rnd.c,v retrieving revision

dev/rnd.c comment typo

2016-12-07 Thread Michael W. Bombardieri
Hi, Two typos in comments & explicit return at end of function returning void. I am a little confused by mixture of memset and explicit_bzero in rnd.c for clearing data. I understand explicit_bzero is meant for clearing sensitive data. Would it be harmful for use only explicit_bzero here? -

Re: KERNEL PATCH: add process hiding (fixed)

2016-12-04 Thread Michael W. Bombardieri
Should this patch also add see_other_uids in sysctl(8) manual? On Sun, Dec 04, 2016 at 07:49:12PM -0500, Ian Walker wrote: > (( Resending my last from a client that (hopefully) won't mangle the email. >Sorry about the noise, folks. )) > > > Hello OpenBSD Community - > > OpenBSD should have

steinberg/yamaha ur22 audio device + openbsd 6.0

2016-09-21 Thread Michael W. Bombardieri
Hi tech, I had some success using Yamaha/Steinberg UR22 usb audio interface box on OpenBSD/i386 6.0. I heard that Linux supports the device but I never tested it under Linux. I spent AUD $150 on the device last year and wondered if it could ever be used with OpenBSD aucat(1). The USB-quirks

Re: Enabling rasops24

2016-09-19 Thread Michael W. Bombardieri
On Mon, Sep 19, 2016 at 06:52:00PM -0400, sven falempin wrote: > Tested here and it works ! @OK > > The terminal is white on red for first part of boot then goes back to white > on > blue. > Also some kind of flicker/bufering during the start, > aftfer the kernel loading no update for like half a

Re: remove /dev/sound*

2016-09-08 Thread Michael W. Bombardieri
Hi Alexandre, Do you know if any applications in ports use /dev/sound as default audio device. Maybe they are not smart enough to try /dev/audio if /dev/sound fails. - Michael On Thu, Sep 08, 2016 at 08:12:45AM +0200, Alexandre Ratchov wrote: > As audio(4) manual says "In all respects

[patch] opencvs rcsnum_free()

2016-06-24 Thread Michael W. Bombardieri
Hi, If people are interested in opencvs diffs again, sharing a rcsnum_free()->free() clean-up item. Note that rcs(1) also has a version of rcsnum_free() which does more than simply call free(). - Michael Index: add.c === RCS

Re: opencvs - fix revision lookups for branches

2016-06-22 Thread Michael W. Bombardieri
Yes please. As noted in older thread that XXX block in rcs.c produced side effects with cvs annotate. https://marc.info/?l=openbsd-tech=144757775319206=2 On Wed, Jun 22, 2016 at 05:20:01PM +0200, Joris Vink wrote: > On Wed, Jun 22, 2016 at 09:07:03AM -0600, Todd C. Miller wrote: > > On Wed, 22

[patch] S_ISDIR() check in yacc TMPDIR

2016-06-21 Thread Michael W. Bombardieri
Hello, Sending this to tech list as suggested by mmcc@... The yacc(1) manual mentions TMPDIR is an extension. The following patch re-factors the checks around TMPDIR. This adds an explicit check for TMPDIR-is-a-directory. With this patch applied, yacc can more reliably determine when it should

[patch] macros in diff

2015-12-29 Thread Michael W. Bombardieri
Hi tech, In diff & friends, use macros MIN() and MAX() instead of defining these locally. Worth doing? - Michael Index: diff/diffreg.c === RCS file: /cvs/src/usr.bin/diff/diffreg.c,v retrieving revision 1.90 diff -u -p -r1.90

[patch] playing with opencvs annotate

2015-11-15 Thread Michael W. Bombardieri
Hi tech@, I had a simple RCS file and opencvs didn't annotate it properly. cat -n $CVSROOT/test/text,v 1 head1.2; 2 access; 3 symbols 4 start:1.1.1.1 5 me:1.1.0.1; 6 locks; strict; 7 comment @# @; 8 9 10 1.2 11

Re: unify xmalloc (was Re: [patch] cvs: retire xfree())

2015-11-11 Thread Michael W. Bombardieri
> > ok for removing xfree from aucat? > > > > yes, ok ratchov; if later this causes me merges i'll find another > solution. Feel free to do the same in usr.bin/sndiod, as it's > almost the same. > Same thing for sndiod... Index: abuf.c

[patch] dc: array_free usage

2015-11-09 Thread Michael W. Bombardieri
Hi tech@, In dc(1) the function array_free() knows how to skip a null pointer so calling code doesn't need to avoid passing null. Also, minor style (braces) clean-up. - Michael Index: bcode.c === RCS file:

Re: unify xmalloc (was Re: [patch] cvs: retire xfree())

2015-11-07 Thread Michael W. Bombardieri
On Thu, Nov 05, 2015 at 03:50:29PM +0100, Tobias Stoeckmann wrote: > On Thu, Nov 05, 2015 at 09:50:48AM +, Nicholas Marriott wrote: > > I don't know why cvs and rcs xmalloc.c has ended up so different. > > It's not just about cvs and rcs: > > /usr/src/usr.bin/cvs/xmalloc.c >

[patch] cvs: retire xfree()

2015-11-04 Thread Michael W. Bombardieri
Hi tech@, Function xfree() was previously removed from rcs, so drop it from opencvs too... http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/rcs/xmalloc.c?f=h#rev1.9 Footnote: I noticed that rcsnum_free() is just free() so maybe that could be removed also (not included in this patch). -

Re: [patch] cvs: retire xfree()

2015-11-04 Thread Michael W. Bombardieri
> Good catch, thanks. > > My eyes glazed over a little while reviewing this, but tentative ok > mmcc@ > > Below is what I consider a better refactoring of buf_free(). It makes it > NULL-safe and has more classic free function logic. I didn't include buf_free() in my patch but that looks good.

Re: [PATCH] rcs: buf_free/rcsnum_free

2015-11-01 Thread Michael W. Bombardieri
--- > From: Tobias Stoeckmann <tob...@stoeckmann.org> > Date:30/10/2015 10:06 (GMT+00:00) > To: "Michael W. Bombardieri" <m...@ii.net> > Cc: Nicholas Marriott <nicholas.marri...@gmail.com>,tech@openbsd.org > Subject: Re: [PATCH] rcs: buf_free/rcsnum_fre

[PATCH] rcs: buf_free/rcsnum_free

2015-10-29 Thread Michael W. Bombardieri
Hi tech@, In case it's considered useful... Submitting patch to shave a few lines from rcs(1) by allowing buf_free() and rcsnum_free() to ignore NULL pointer. - Michael Index: buf.c === RCS file: /cvs/src/usr.bin/rcs/buf.c,v

Re: [PATCH] rcs: buf_free/rcsnum_free

2015-10-29 Thread Michael W. Bombardieri
On Thu, Oct 29, 2015 at 10:54:09AM +, Nicholas Marriott wrote: > Hi > > You missed ci.c:316 and a few in rcs.c and rcsdiff.c Sorry. Here is new diff. Hopefully I haven't missed anything else. Index: buf.c === RCS file:

[patch]rcs: remove a goto

2015-06-14 Thread Michael W. Bombardieri
Hi tech, The following patch eliminates one goto in rcs(1). The goto was used for skipping over rcs_set_description(). This can be handed in the if which already encloses rcs_set_description(). - Michael Index: ci.c === RCS file:

awk: xfree() macro

2015-02-24 Thread Michael W. Bombardieri
Hi tech, Forwarding this in case it is considered useful. Trying to clean up xfree() macro in awk. Remove check for NULL before calling free(). As a side effect, we might set something to NULL which is already NULL (but I suppose that's ok). - Michael Index: awk.h

[patch] libssl/src/ssl/ssl_rsa.c

2014-05-08 Thread Michael W. Bombardieri
Hi tech@, In case this is considered important enough... Remove unused ret from SSL_use_PrivateKey(). - Michael Index: ssl_rsa.c === RCS file: /cvs/src/lib/libssl/src/ssl/ssl_rsa.c,v retrieving revision 1.11 diff -u -r1.11

patch: libssl/src/ssl/t1_enc.c

2014-04-23 Thread Michael W. Bombardieri
Hi tech@, Submitting patch to simplify code around free(3) in libssl. free() already handles the NULL case. Does this look ok? - Michael Index: t1_enc.c === RCS file: /cvs/src/lib/libssl/src/ssl/t1_enc.c,v retrieving revision

small patch: CRYPTO_memcmp

2014-04-22 Thread Michael W. Bombardieri
Hi tech@, Sending this patch for comment... CRYPTO_memcmp() is different to memcmp() because it can only check for equality, not greater-than/less-than. If we check the string in reverse order we can remove a variable from the comparison loop. Does this look ok? - Michael Index: cryptlib.c

[PATCH] Potential bug fix for opencvs annotate

2013-03-27 Thread Michael W. Bombardieri
Hi, I'm re-posting this in hope. :) http://marc.info/?l=openbsd-techm=135698142814632w=2 Please let me know if I can provide any further info. - Michael

[PATCH] knf src/sys/net/if_pppoe.c

2013-03-10 Thread Michael W. Bombardieri
Hi tech, I have a minor KNF patch for if_pppoe.c... Submitting this in case anyone is interested. - Michael Index: if_pppoe.c === RCS file: /cvs/src/sys/net/if_pppoe.c,v retrieving revision 1.35 diff -u -r1.35 if_pppoe.c ---

Re: [PATCH] awk: initialisation of struct

2013-01-06 Thread Michael W. Bombardieri
On Thu, Jan 03, 2013 at 09:23:50PM -0800, Philip Guenther wrote: On Thu, Jan 3, 2013 at 8:48 PM, Michael W. Bombardieri m...@ii.net wrote: I am submitting a patch for awk. struct Cell has 7 fields; the final field is an optional next pointer. ... Splint identified that instances of Cell

[PATCH] awk: initialisation of struct

2013-01-03 Thread Michael W. Bombardieri
Hi, I am submitting a patch for awk. struct Cell has 7 fields; the final field is an optional next pointer. 79 typedef struct Cell { 80 uschar ctype; /* OCELL, OBOOL, OJUMP, etc. */ 81 uschar csub; /* CCON, CTEMP, CFLD, etc. */ 82 char*nval; /* name, for

[PATCH] iovec array size in pppoe

2013-01-02 Thread Michael W. Bombardieri
Hi, I am submitting a small patch for pppoe... The iovec array in send_padi() can contain either 7 or 8 elements. The following patch declares the array as having size of 8 rather than 10. Does this look OK? - Michael Index: client.c

  1   2   >