diff options
author | Mukund Sivaraman <muks@banu.com> | 2009-09-24 14:11:47 +0530 |
---|---|---|
committer | Mukund Sivaraman <muks@banu.com> | 2009-09-27 08:09:24 +0530 |
commit | 54f4e8a91ff9087e55d375f8c48f893b956afb28 (patch) | |
tree | 75a53ff0a1262389d6a34c1cb567907d2ed7e59c /src | |
parent | 43d0af85af92c93671dcc7016b58ee42af8c863d (diff) | |
download | tinyproxy-54f4e8a91ff9087e55d375f8c48f893b956afb28.tar.gz tinyproxy-54f4e8a91ff9087e55d375f8c48f893b956afb28.zip |
Use correct format string for POSIX pid_t in pidfile_create()
This patch also adds a gtk-doc comment for pidfile_create().
Diffstat (limited to '')
-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; } |