diff options
author | Stefan Seyfried <stefan.seyfried@googlemail.com> | 2008-04-21 10:20:14 +0000 |
---|---|---|
committer | Stefan Seyfried <stefan.seyfried@googlemail.com> | 2008-04-21 10:20:14 +0000 |
commit | 28988dc50f47e87c3e21d7f8bf24b170f8078400 (patch) | |
tree | 22ed802dc80238e924d5213fdb1149691d65e4ea | |
parent | c0113a319596dd1fc98ef2a884c72ad048543206 (diff) | |
download | suspend-utils-28988dc50f47e87c3e21d7f8bf24b170f8078400.tar.gz |
Fix signed/unsigned-comparison compiler warnings (patch by Alon Bar-Lev)
-rw-r--r-- | swap-offset.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/swap-offset.c b/swap-offset.c index 50308dc..b0cccca 100644 --- a/swap-offset.c +++ b/swap-offset.c @@ -29,7 +29,8 @@ int main(int argc, char **argv) unsigned int offset; int size, blk_size; int fd; - int i; + unsigned int i; + ssize_t ret; struct stat stat; unsigned char buf[SWAP_SIG_SIZE]; int err = 0; @@ -53,12 +54,12 @@ int main(int argc, char **argv) perror("lseek()"); goto out; } - i = read(fd, buf, SWAP_SIG_SIZE); - if (i < 0) { + ret = read(fd, buf, SWAP_SIG_SIZE); + if (ret < 0) { err = errno; perror("read()"); goto out; - } else if (i < SWAP_SIG_SIZE) { + } else if (ret < SWAP_SIG_SIZE) { fprintf(stderr, "Failed to read swap signature: file is too short.\n"); err = EINVAL; goto out; |