diff options
author | Bill Nottingham <notting@redhat.com> | 2012-12-04 10:36:54 -0500 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2012-12-04 10:36:54 -0500 |
commit | 7d6db66be21f22ad45c2ed961adb8eb10a7ea35e (patch) | |
tree | 8c0868aec1fc5eb4c96ee8661ab0055f1da36495 | |
parent | f386b81c2fa48fe9f66bdb446cde99f99ae44912 (diff) | |
download | initscripts-7d6db66be21f22ad45c2ed961adb8eb10a7ea35e.tar initscripts-7d6db66be21f22ad45c2ed961adb8eb10a7ea35e.tar.gz initscripts-7d6db66be21f22ad45c2ed961adb8eb10a7ea35e.tar.bz2 initscripts-7d6db66be21f22ad45c2ed961adb8eb10a7ea35e.tar.xz initscripts-7d6db66be21f22ad45c2ed961adb8eb10a7ea35e.zip |
Fix amazingly long-standing thinko in writing the pid file to the lock.
-rw-r--r-- | src/rename_device.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rename_device.c b/src/rename_device.c index f96291b0..c6a99152 100644 --- a/src/rename_device.c +++ b/src/rename_device.c @@ -241,7 +241,10 @@ void take_lock() { while (1) { lockfd = open(LOCKFILE, O_RDWR|O_CREAT|O_EXCL, 0644); if (lockfd != -1) { - write(lockfd,"%d\n",getpid()); + char buf[32]; + + snprintf(buf,32,"%d\n",getpid()); + write(lockfd,buf,strlen(buf)); close(lockfd); break; } |