From f44793656c975344d91a6ff4cad92c144fda0622 Mon Sep 17 00:00:00 2001 From: des Date: Wed, 23 May 2007 12:10:20 +0000 Subject: [PATCH] Avoid shadowing truncate(2) with a local variable. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1469 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/lib/libvarnish/flopen.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/varnish-cache/lib/libvarnish/flopen.c b/varnish-cache/lib/libvarnish/flopen.c index fcca6d3b..94f08d30 100644 --- a/varnish-cache/lib/libvarnish/flopen.c +++ b/varnish-cache/lib/libvarnish/flopen.c @@ -26,7 +26,7 @@ * * $Id$ * Derived from: - * $FreeBSD: src/lib/libutil/flopen.c,v 1.6 2007/05/23 10:06:03 des Exp $ + * $FreeBSD: src/lib/libutil/flopen.c,v 1.7 2007/05/23 12:09:33 des Exp $ */ #include @@ -42,7 +42,7 @@ int flopen(const char *path, int flags, ...) { - int fd, operation, serrno, truncate; + int fd, operation, serrno, trunc; struct stat sb, fsb; mode_t mode; @@ -63,7 +63,7 @@ flopen(const char *path, int flags, ...) if (flags & O_NONBLOCK) operation |= LOCK_NB; - truncate = (flags & O_TRUNC); + trunc = (flags & O_TRUNC); flags &= ~O_TRUNC; for (;;) { @@ -95,7 +95,7 @@ flopen(const char *path, int flags, ...) close(fd); continue; } - if (truncate && ftruncate(fd, 0) != 0) { + if (trunc && ftruncate(fd, 0) != 0) { /* can't happen [tm] */ serrno = errno; close(fd); -- 2.39.5