diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/utils.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/utils.c b/src/utils.c index 239952c..ef2e673 100644 --- a/src/utils.c +++ b/src/utils.c @@ -177,10 +177,16 @@ int create_file_safely (const char *filename, unsigned int truncate_file) return fildes; } -/* - * Write the PID of the program to the specified file. - */ -int pidfile_create (const char *filename) +/** + * pidfile_create: + * @filename: The name of the file which should be created. + * + * 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; FILE *fd; @@ -203,7 +209,7 @@ int pidfile_create (const char *filename) return -EIO; } - fprintf (fd, "%ld\n", (long) getpid ()); + fprintf (fd, "%d\n", getpid ()); fclose (fd); return 0; } |