summaryrefslogtreecommitdiff
path: root/source4/lib/util/pidfile.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-04-24 09:36:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:04:15 -0500
commit0eddf14b307e905663b95296aa695a10d3fb90f7 (patch)
tree47048c771464eeae7d38cd44ff4584544452f96e /source4/lib/util/pidfile.c
parente26eea97872f856d35463834d42b86e58b144f58 (diff)
downloadsamba-0eddf14b307e905663b95296aa695a10d3fb90f7.tar.gz
samba-0eddf14b307e905663b95296aa695a10d3fb90f7.tar.bz2
samba-0eddf14b307e905663b95296aa695a10d3fb90f7.zip
r15191: Avoid uint_t as it's not standard.
(This used to be commit 7af59357b94e3819415b3a9257be0ced745ce130)
Diffstat (limited to 'source4/lib/util/pidfile.c')
-rw-r--r--source4/lib/util/pidfile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/lib/util/pidfile.c b/source4/lib/util/pidfile.c
index 1a46e6e70c..dc9ecafae9 100644
--- a/source4/lib/util/pidfile.c
+++ b/source4/lib/util/pidfile.c
@@ -40,7 +40,7 @@ _PUBLIC_ pid_t pidfile_pid(const char *name)
{
int fd;
char pidstr[20];
- uint_t ret;
+ pid_t ret;
char *pidFile;
asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name);
@@ -58,9 +58,9 @@ _PUBLIC_ pid_t pidfile_pid(const char *name)
goto noproc;
}
- ret = atoi(pidstr);
+ ret = (pid_t)atoi(pidstr);
- if (!process_exists((pid_t)ret)) {
+ if (!process_exists(ret)) {
goto noproc;
}
@@ -71,7 +71,7 @@ _PUBLIC_ pid_t pidfile_pid(const char *name)
close(fd);
SAFE_FREE(pidFile);
- return (pid_t)ret;
+ return ret;
noproc:
close(fd);
@@ -113,7 +113,7 @@ void pidfile_create(const char *name)
}
memset(buf, 0, sizeof(buf));
- slprintf(buf, sizeof(buf) - 1, "%u\n", (uint_t) getpid());
+ slprintf(buf, sizeof(buf) - 1, "%u\n", (unsigned int) getpid());
if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) {
DEBUG(0,("ERROR: can't write to file %s: %s\n",
pidFile, strerror(errno)));