diff options
author | Werner Koch <[email protected]> | 1999-02-16 13:16:33 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1999-02-16 13:16:33 +0000 |
commit | e1a1b3fc90af66a5db5ee92514b0a7c52e49d1ed (patch) | |
tree | 31dd54ac26b4c3fc30cc93d66161e72bf4cf7927 /util/dotlock.c | |
parent | See ChangeLog: Sat Feb 13 14:13:04 CET 1999 Werner Koch (diff) | |
download | gnupg-e1a1b3fc90af66a5db5ee92514b0a7c52e49d1ed.tar.gz gnupg-e1a1b3fc90af66a5db5ee92514b0a7c52e49d1ed.zip |
See ChangeLog: Tue Feb 16 14:10:02 CET 1999 Werner Koch
Diffstat (limited to 'util/dotlock.c')
-rw-r--r-- | util/dotlock.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/util/dotlock.c b/util/dotlock.c index 656454ee3..213f0d38e 100644 --- a/util/dotlock.c +++ b/util/dotlock.c @@ -85,7 +85,7 @@ create_dotlock( const char *file_to_lock ) h = m_alloc_clear( sizeof *h ); #ifndef HAVE_DOSISH_SYSTEM - sprintf( pidstr, "%10d\n", getpid() ); + sprintf( pidstr, "%10d\n", (int)getpid() ); /* fixme: add the hostname to the second line (FQDN or IP addr?) */ /* create a temporary file */ @@ -298,12 +298,13 @@ read_lockfile( const char *name ) errno = e; return -1; } - if( read(fd, pidstr, 10 ) != 10 ) { + if( read(fd, pidstr, 10 ) != 10 ) { /* Read 10 digits w/o newline */ log_debug("error reading lockfile `%s'", name ); close(fd); errno = 0; return -1; } + pidstr[10] = 0; /* terminate pid string */ close(fd); pid = atoi(pidstr); if( !pid || pid == -1 ) { |