History log of /openbsd-current/lib/libutil/uucplock.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.21 03-Jul-2019 deraadt

snprintf/vsnprintf return < 0 on error, rather than -1.


# 1.20 28-Jun-2019 deraadt

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.19 30-Aug-2016 guenther

Use a constant format string and output the variable part with %s

ok krw@ millert@


# 1.18 30-Aug-2016 guenther

Use O_CLOEXEC when opening fds local to a function

ok jca@ krw@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.17 11-Nov-2015 deraadt

creat() -> open equiv; from Frederic Nowak


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.16 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.15 30-Mar-2006 deraadt

casts that cannot cause breakage in the future


Revision tags: OPENBSD_3_9_BASE
# 1.14 28-Nov-2005 deraadt

spaces, and a off_t typecast to please lint


Revision tags: OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.13 03-Mar-2005 cloder

Make sure we check snprintf return value for failure or truncation before
using it. Make uu_lock_txfr work by properly checking return value from
put_pid(). Fix an FD leak on the lockfile in an error path (from FreeBSD
with modifications). OK millert@, input from otto@ and Bruno Rohee.


Revision tags: OPENBSD_3_6_BASE
# 1.12 28-May-2004 deraadt

knf; otto ok


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.11 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.10 09-Jun-2002 fgsch

some -Wall and spaces cleanup, scsi.c left.
some brave soul should look at it.


# 1.9 26-May-2002 deraadt

pid_t cleanup


Revision tags: OPENBSD_3_1_BASE
# 1.8 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.7 21-Sep-1999 csapuntz

Add opendisk from NetBSD.

Add OpenBSD tags to files


# 1.6 17-Aug-1999 millert

More <sys/file.h> vs. <fcntl.h> and open() flags fixes.


Revision tags: OPENBSD_2_5_BASE
# 1.5 16-Mar-1999 brian

Get the pid right if a stale lock file exists.
Submitted by: Lawrence D. Lopez <lopez@cisco.com>


Revision tags: OPENBSD_2_4_BASE
# 1.4 10-Jun-1998 brian

Cast pid_t to int for sprintf.
Pointed out by: Charlie Sorsby <crs@hgo.net>


# 1.3 08-Jun-1998 brian

Add uu_lock_txfr() for donating locks to another process.
Reviewed by: Theo


Revision tags: OPENBSD_2_3_BASE
# 1.2 09-Nov-1997 bri

Correct the ftruncate() call.


# 1.1 09-Nov-1997 bri

Introduce uu_lock(), uu_unlock() and uu_lockerr()
into libutil.
Obtained from: FreeBSD
Reviewed by: Theo


# 1.20 28-Jun-2019 deraadt

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.19 30-Aug-2016 guenther

Use a constant format string and output the variable part with %s

ok krw@ millert@


# 1.18 30-Aug-2016 guenther

Use O_CLOEXEC when opening fds local to a function

ok jca@ krw@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.17 11-Nov-2015 deraadt

creat() -> open equiv; from Frederic Nowak


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.16 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.15 30-Mar-2006 deraadt

casts that cannot cause breakage in the future


Revision tags: OPENBSD_3_9_BASE
# 1.14 28-Nov-2005 deraadt

spaces, and a off_t typecast to please lint


Revision tags: OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.13 03-Mar-2005 cloder

Make sure we check snprintf return value for failure or truncation before
using it. Make uu_lock_txfr work by properly checking return value from
put_pid(). Fix an FD leak on the lockfile in an error path (from FreeBSD
with modifications). OK millert@, input from otto@ and Bruno Rohee.


Revision tags: OPENBSD_3_6_BASE
# 1.12 28-May-2004 deraadt

knf; otto ok


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.11 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.10 09-Jun-2002 fgsch

some -Wall and spaces cleanup, scsi.c left.
some brave soul should look at it.


# 1.9 26-May-2002 deraadt

pid_t cleanup


Revision tags: OPENBSD_3_1_BASE
# 1.8 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.7 21-Sep-1999 csapuntz

Add opendisk from NetBSD.

Add OpenBSD tags to files


# 1.6 17-Aug-1999 millert

More <sys/file.h> vs. <fcntl.h> and open() flags fixes.


Revision tags: OPENBSD_2_5_BASE
# 1.5 16-Mar-1999 brian

Get the pid right if a stale lock file exists.
Submitted by: Lawrence D. Lopez <lopez@cisco.com>


Revision tags: OPENBSD_2_4_BASE
# 1.4 10-Jun-1998 brian

Cast pid_t to int for sprintf.
Pointed out by: Charlie Sorsby <crs@hgo.net>


# 1.3 08-Jun-1998 brian

Add uu_lock_txfr() for donating locks to another process.
Reviewed by: Theo


Revision tags: OPENBSD_2_3_BASE
# 1.2 09-Nov-1997 bri

Correct the ftruncate() call.


# 1.1 09-Nov-1997 bri

Introduce uu_lock(), uu_unlock() and uu_lockerr()
into libutil.
Obtained from: FreeBSD
Reviewed by: Theo


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.19 30-Aug-2016 guenther

Use a constant format string and output the variable part with %s

ok krw@ millert@


# 1.18 30-Aug-2016 guenther

Use O_CLOEXEC when opening fds local to a function

ok jca@ krw@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.17 11-Nov-2015 deraadt

creat() -> open equiv; from Frederic Nowak


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.16 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.15 30-Mar-2006 deraadt

casts that cannot cause breakage in the future


Revision tags: OPENBSD_3_9_BASE
# 1.14 28-Nov-2005 deraadt

spaces, and a off_t typecast to please lint


Revision tags: OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.13 03-Mar-2005 cloder

Make sure we check snprintf return value for failure or truncation before
using it. Make uu_lock_txfr work by properly checking return value from
put_pid(). Fix an FD leak on the lockfile in an error path (from FreeBSD
with modifications). OK millert@, input from otto@ and Bruno Rohee.


Revision tags: OPENBSD_3_6_BASE
# 1.12 28-May-2004 deraadt

knf; otto ok


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.11 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.10 09-Jun-2002 fgsch

some -Wall and spaces cleanup, scsi.c left.
some brave soul should look at it.


# 1.9 26-May-2002 deraadt

pid_t cleanup


Revision tags: OPENBSD_3_1_BASE
# 1.8 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.7 21-Sep-1999 csapuntz

Add opendisk from NetBSD.

Add OpenBSD tags to files


# 1.6 17-Aug-1999 millert

More <sys/file.h> vs. <fcntl.h> and open() flags fixes.


Revision tags: OPENBSD_2_5_BASE
# 1.5 16-Mar-1999 brian

Get the pid right if a stale lock file exists.
Submitted by: Lawrence D. Lopez <lopez@cisco.com>


Revision tags: OPENBSD_2_4_BASE
# 1.4 10-Jun-1998 brian

Cast pid_t to int for sprintf.
Pointed out by: Charlie Sorsby <crs@hgo.net>


# 1.3 08-Jun-1998 brian

Add uu_lock_txfr() for donating locks to another process.
Reviewed by: Theo


Revision tags: OPENBSD_2_3_BASE
# 1.2 09-Nov-1997 bri

Correct the ftruncate() call.


# 1.1 09-Nov-1997 bri

Introduce uu_lock(), uu_unlock() and uu_lockerr()
into libutil.
Obtained from: FreeBSD
Reviewed by: Theo