From f1c30c98b9c9720f2a542df7ae0b9cde4c162e7a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 2 Sep 2003 07:14:15 +0000 Subject: (CFLAGS-oldtmpfile.c): Add -fexceptions. --- sysdeps/unix/sysv/linux/getloadavg.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sysdeps/unix/sysv/linux/getloadavg.c') diff --git a/sysdeps/unix/sysv/linux/getloadavg.c b/sysdeps/unix/sysv/linux/getloadavg.c index e1a372cd5f..6ef17fe0d0 100644 --- a/sysdeps/unix/sysv/linux/getloadavg.c +++ b/sysdeps/unix/sysv/linux/getloadavg.c @@ -1,5 +1,5 @@ /* Get system load averages. Linux (/proc/loadavg) version. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,7 @@ #include #include #include +#include /* Put the 1 minute, 5 minute and 15 minute load averages into the first NELEM elements of LOADAVG. @@ -33,7 +34,7 @@ getloadavg (double loadavg[], int nelem) { int fd; - fd = __open ("/proc/loadavg", O_RDONLY); + fd = open_not_cancel_2 ("/proc/loadavg", O_RDONLY); if (fd < 0) return -1; else @@ -42,8 +43,8 @@ getloadavg (double loadavg[], int nelem) ssize_t nread; int i; - nread = __read (fd, buf, sizeof buf - 1); - __close (fd); + nread = read_not_cancel (fd, buf, sizeof buf - 1); + close_not_cancel_no_status (fd); if (nread < 0) return -1; buf[nread - 1] = '\0'; -- cgit 1.4.1