This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

clock_getcpuclockid: don't return random data


This fixes the warning:

../sysdeps/unix/sysv/linux/clock_getcpuclockid.c: In function 'clock_getcpuclockid':
../sysdeps/unix/sysv/linux/clock_getcpuclockid.c:103: warning: control reaches end of non-void function

Andreas.

2005-05-17  Andreas Schwab  <schwab@suse.de>

	* sysdeps/unix/sysv/linux/clock_getcpuclockid.c
	(clock_getcpuclockid): Always return a defined value.

--- sysdeps/unix/sysv/linux/clock_getcpuclockid.c.~1.1.~	2005-04-27 10:01:39.000000000 +0200
+++ sysdeps/unix/sysv/linux/clock_getcpuclockid.c	2005-05-06 12:15:36.000000000 +0200
@@ -1,5 +1,5 @@
 /* clock_getcpuclockid -- Get a clockid_t for process CPU time.  Linux version.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 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
@@ -38,11 +38,11 @@ clock_getcpuclockid (pid_t pid, clockid_
 
 # if !(__ASSUME_POSIX_CPU_TIMERS > 0)
   extern int __libc_missing_posix_cpu_timers attribute_hidden;
-# if !(__ASSUME_POSIX_TIMERS > 0)
+#  if !(__ASSUME_POSIX_TIMERS > 0)
   extern int __libc_missing_posix_timers attribute_hidden;
   if (__libc_missing_posix_timers && !__libc_missing_posix_cpu_timers)
     __libc_missing_posix_cpu_timers = 1;
-# endif
+#  endif
   if (!__libc_missing_posix_cpu_timers)
 # endif
     {
@@ -82,7 +82,7 @@ clock_getcpuclockid (pid_t pid, clockid_
 	else
 	  return INTERNAL_SYSCALL_ERRNO (r, err);
     }
-# endif
+#endif
 
   /* We don't allow any process ID but our own.  */
   if (pid != 0 && pid != getpid ())
@@ -96,8 +96,8 @@ clock_getcpuclockid (pid_t pid, clockid_
 
       return 0;
     }
-#else
+#endif
+
   /* We don't have a timer for that.  */
   return ENOENT;
-#endif
 }

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]