X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;ds=sidebyside;f=liblttng-ust-comm%2Flttng-ust-fd-tracker.c;h=1bc186bf08453f870001446ebf17dbb0e2ab2054;hb=46e08d2c915a42efa00b896c818da5351e493322;hp=329339f98a038736fe528bc856bdeff1737b4c2b;hpb=0818d379673441930e5106c9c3ad3db0499c1c4c;p=lttng-ust.git diff --git a/liblttng-ust-comm/lttng-ust-fd-tracker.c b/liblttng-ust-comm/lttng-ust-fd-tracker.c index 329339f9..1bc186bf 100644 --- a/liblttng-ust-comm/lttng-ust-fd-tracker.c +++ b/liblttng-ust-comm/lttng-ust-fd-tracker.c @@ -146,7 +146,7 @@ void lttng_ust_unlock_fd_tracker(void) static int dup_std_fd(int fd) { - int ret; + int ret, i; int fd_to_close[STDERR_FILENO + 1]; int fd_to_close_count = 0; int dup_cmd = F_DUPFD; /* Default command */ @@ -171,7 +171,7 @@ static int dup_std_fd(int fd) } /* Perform dup */ - for (int i = 0; i < STDERR_FILENO + 1; i++) { + for (i = 0; i < STDERR_FILENO + 1; i++) { ret = fcntl(fd, dup_cmd, 0); if (ret < 0) { PERROR("fcntl dup fd"); @@ -192,7 +192,7 @@ static int dup_std_fd(int fd) } /* Close intermediary fds */ - for (int i = 0; i < fd_to_close_count; i++) { + for (i = 0; i < fd_to_close_count; i++) { ret = close(fd_to_close[i]); if (ret) { PERROR("close on temporary fd: %d.", fd_to_close[i]);