Use correct format string for POSIX pid_t in pidfile_create()
This patch also adds a gtk-doc comment for pidfile_create().
This commit is contained in:
parent
43d0af85af
commit
54f4e8a91f
16
src/utils.c
16
src/utils.c
@ -177,10 +177,16 @@ int create_file_safely (const char *filename, unsigned int truncate_file)
|
|||||||
return fildes;
|
return fildes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Write the PID of the program to the specified file.
|
* pidfile_create:
|
||||||
*/
|
* @filename: The name of the file which should be created.
|
||||||
int pidfile_create (const char *filename)
|
*
|
||||||
|
* Creates a file with the PID of the Tinyproxy process.
|
||||||
|
*
|
||||||
|
* Returns: %0 on success, non-zero values on errors.
|
||||||
|
**/
|
||||||
|
int
|
||||||
|
pidfile_create (const char *filename)
|
||||||
{
|
{
|
||||||
int fildes;
|
int fildes;
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
@ -203,7 +209,7 @@ int pidfile_create (const char *filename)
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (fd, "%ld\n", (long) getpid ());
|
fprintf (fd, "%d\n", getpid ());
|
||||||
fclose (fd);
|
fclose (fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user