From d12c5f3d31391eefaf330c9598e1195d96935025 Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Mon, 4 Jun 2018 17:32:34 +0200 Subject: src/rename_device.c: GCC warnings about unused return value suppressed --- src/rename_device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rename_device.c b/src/rename_device.c index 6d6030eb..c39f447d 100644 --- a/src/rename_device.c +++ b/src/rename_device.c @@ -281,6 +281,7 @@ char *get_config_by_hwaddr(char *hwaddr, char *current) { void take_lock() { int count = 0; int lockfd; + ssize_t ignored_retval __attribute__((unused)); while (1) { lockfd = open(LOCKFILE, O_RDWR|O_CREAT|O_EXCL, 0644); @@ -288,7 +289,7 @@ void take_lock() { char buf[32]; snprintf(buf,32,"%d\n",getpid()); - write(lockfd,buf,strlen(buf)); + ignored_retval = write(lockfd,buf,strlen(buf)); close(lockfd); break; } else if (errno == EACCES) @@ -304,7 +305,7 @@ void take_lock() { fd = open(LOCKFILE, O_RDONLY); if (fd == -1) break; - read(fd,buf,32); + ignored_retval = read(fd,buf,32); close(fd); pid = atoi(buf); if (pid && pid != 1) { -- cgit v1.2.1