Signed-off-by: Sami Kerola <kerolasa@iki.fi>
char buf[BUFSIZ], *res = NULL;
ssize_t sz = 0;
size_t i;
- int fd = -1;
+ int fd;
snprintf(buf, sizeof(buf), "/proc/%d/cmdline", (int) pid);
fd = open(buf, O_RDONLY);
stats[0] = range[0], stats[1] = 0;
gettime_monotonic(&last);
- for (range[0] = range[0]; range[0] < end; range[0] += range[1]) {
+ for (/* nothing */; range[0] < end; range[0] += range[1]) {
if (range[0] + range[1] > end)
range[1] = end - range[0];
static int fstrim_filesystem(const char *path, struct fstrim_range *rangetpl,
int verbose)
{
- int fd = -1, rc;
+ int fd, rc;
struct stat sb;
struct fstrim_range range;