Print this page
10137 smatch fixes for setuname

*** 25,35 **** /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ ! #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3 */ /* * setuname [-t] [-s name] [-n node] */ --- 25,37 ---- /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ ! /* ! * Copyright (c) 2018, Joyent, Inc. ! */ /* * setuname [-t] [-s name] [-n node] */
*** 450,460 **** sizeof (utsname.sysname)); if (nodename) (void) strncpy(utsname.nodename, nodename, sizeof (utsname.nodename)); (void) kvm_kwrite(kd, utsname_addr, &utsname, sizeof (utsname)); ! kvm_close(kd); } else return (-1); #else /* sun */ if ((memfd = open("/dev/kmem", O_RDWR, 0)) > 0) { if ((lseek(memfd, (long) utsname_addr, SEEK_SET) != -1) && --- 452,462 ---- sizeof (utsname.sysname)); if (nodename) (void) strncpy(utsname.nodename, nodename, sizeof (utsname.nodename)); (void) kvm_kwrite(kd, utsname_addr, &utsname, sizeof (utsname)); ! (void) kvm_close(kd); } else return (-1); #else /* sun */ if ((memfd = open("/dev/kmem", O_RDWR, 0)) > 0) { if ((lseek(memfd, (long) utsname_addr, SEEK_SET) != -1) &&