mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
See ChangeLog: Tue Feb 16 14:10:02 CET 1999 Werner Koch
This commit is contained in:
parent
6e5bc13878
commit
e1a1b3fc90
53 changed files with 359 additions and 279 deletions
|
@ -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 ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue