diff options
author | Mark Eichin <eichin@mit.edu> | 1995-11-16 03:08:18 +0000 |
---|---|---|
committer | Mark Eichin <eichin@mit.edu> | 1995-11-16 03:08:18 +0000 |
commit | aa9faf302a09736947dd70b0b05d4fcbb06c37b9 (patch) | |
tree | 3bcd696cb885af9eda56e15823ff674f0f24d4fb /src/lib/krb4/tf_util.c | |
parent | 1b24d5b626e4999085efdfec6b32033fb09dab07 (diff) | |
download | krb5-aa9faf302a09736947dd70b0b05d4fcbb06c37b9.tar.gz krb5-aa9faf302a09736947dd70b0b05d4fcbb06c37b9.tar.xz krb5-aa9faf302a09736947dd70b0b05d4fcbb06c37b9.zip |
* *.c (*): initialize lock_arg to a copy of a static
(thus zero) struct flock, to avoid panic'ing sunos 4.1.4.
If you call fcntl F_SETLKW with l_type == F_UNLCK and l_xxx == 15
(GRANT_LOCK_FLAG) you'll panic sunos 4.1.4 with
assertion failed: ld->l_xxx != GRANT_LOCK_FLAG, file: ../../ufs/ufs_lockf.c, line: 995
Since automatic structs like these have random values in uninitialized
fields, we initialize from a static struct (since using memset in this
case is abhorrent, and naming l_xxx is non POSIX.)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7109 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb4/tf_util.c')
-rw-r--r-- | src/lib/krb4/tf_util.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/krb4/tf_util.c b/src/lib/krb4/tf_util.c index 02af59d4b..7761b3d58 100644 --- a/src/lib/krb4/tf_util.c +++ b/src/lib/krb4/tf_util.c @@ -76,8 +76,11 @@ int utimes(path, times) int emul_flock(fd, cmd) int fd, cmd; { + static struct flock flock_zero; struct flock f; + f = flock_zero; + memset(&f, 0, sizeof (f)); if (cmd & LOCK_UN) |