* lib/commonio.c: len should be typed ssize_t as it is the return
of read(), and is compared to 0. Cast to size_t when necessary.
This commit is contained in:
parent
d3abd86df5
commit
d65354efcf
@ -1,3 +1,8 @@
|
|||||||
|
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* lib/commonio.c: len should be typed ssize_t as it is the return
|
||||||
|
of read(), and is compared to 0. Cast to size_t when necessary.
|
||||||
|
|
||||||
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
|
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* libmisc/find_new_ids.c: Use getdef_ulong to retrieve UIDs/GIDs
|
* libmisc/find_new_ids.c: Use getdef_ulong to retrieve UIDs/GIDs
|
||||||
|
@ -113,7 +113,7 @@ static int do_lock_file (const char *file, const char *lock)
|
|||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
size_t len;
|
ssize_t len;
|
||||||
int retval;
|
int retval;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
@ -124,8 +124,8 @@ static int do_lock_file (const char *file, const char *lock)
|
|||||||
|
|
||||||
pid = getpid ();
|
pid = getpid ();
|
||||||
snprintf (buf, sizeof buf, "%lu", (unsigned long) pid);
|
snprintf (buf, sizeof buf, "%lu", (unsigned long) pid);
|
||||||
len = strlen (buf) + 1;
|
len = (ssize_t) strlen (buf) + 1;
|
||||||
if (write (fd, buf, len) != (ssize_t) len) {
|
if (write (fd, buf, (size_t) len) != len) {
|
||||||
(void) close (fd);
|
(void) close (fd);
|
||||||
unlink (file);
|
unlink (file);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user