[git commit future 1/1] clock_{g, s}ettime.c, {create, delete}_module.c: cleanup

Khem Raj raj.khem at gmail.com
Sat Mar 19 18:51:25 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=6059e72815929e2b049c6c76ea9db639d415e341
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future

Do not include unneeded headers.
Move headers to the needed place.
Fix a comment typo.

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
 libc/sysdeps/linux/common/clock_gettime.c |    2 +-
 libc/sysdeps/linux/common/clock_settime.c |    2 +-
 libc/sysdeps/linux/common/create_module.c |    8 ++++----
 libc/sysdeps/linux/common/delete_module.c |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libc/sysdeps/linux/common/clock_gettime.c b/libc/sysdeps/linux/common/clock_gettime.c
index d3755a7..95d3982 100644
--- a/libc/sysdeps/linux/common/clock_gettime.c
+++ b/libc/sysdeps/linux/common/clock_gettime.c
@@ -10,11 +10,11 @@
 
 #include <sys/syscall.h>
 #include <time.h>
-#include <sys/time.h>
 
 #ifdef __NR_clock_gettime
 _syscall2(int, clock_gettime, clockid_t, clock_id, struct timespec*, tp)
 #else
+# include <sys/time.h>
 
 int clock_gettime(clockid_t clock_id, struct timespec* tp)
 {
diff --git a/libc/sysdeps/linux/common/clock_settime.c b/libc/sysdeps/linux/common/clock_settime.c
index 0c9c840..636f184 100644
--- a/libc/sysdeps/linux/common/clock_settime.c
+++ b/libc/sysdeps/linux/common/clock_settime.c
@@ -9,11 +9,11 @@
 
 #include <sys/syscall.h>
 #include <time.h>
-#include <sys/time.h>
 
 #ifdef __NR_clock_settime
 _syscall2(int, clock_settime, clockid_t, clock_id, const struct timespec*, tp)
 #else
+# include <sys/time.h>
 
 int clock_settime(clockid_t clock_id, const struct timespec* tp)
 {
diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c
index ddd7c4c..5bded56 100644
--- a/libc/sysdeps/linux/common/create_module.c
+++ b/libc/sysdeps/linux/common/create_module.c
@@ -7,10 +7,10 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-#include <errno.h>
-#include <unistd.h>
 #include <features.h>
-#include <sys/types.h>
+#define __need_size_t
+#include <stddef.h>
+#include <errno.h>
 #include <sys/syscall.h>
 
 #ifdef __NR_create_module
@@ -22,7 +22,7 @@ unsigned long create_module(const char *name, size_t size);
 static __inline__ _syscall2(long, __create_module, const char *, name, size_t, size)
 /* By checking the value of errno, we know if we have been fooled
  * by the syscall2 macro making a very high address look like a
- * negative, so we we fix it up here.  */
+ * negative, so we fix it up here.  */
 unsigned long create_module(const char *name, size_t size)
 {
 	long ret = __create_module(name, size);
diff --git a/libc/sysdeps/linux/common/delete_module.c b/libc/sysdeps/linux/common/delete_module.c
index 8ac6e55..05841d4 100644
--- a/libc/sysdeps/linux/common/delete_module.c
+++ b/libc/sysdeps/linux/common/delete_module.c
@@ -7,7 +7,7 @@
  */
 
 #include <sys/syscall.h>
-int delete_module(const char *name, unsigned int flags);
 #ifdef __NR_delete_module
+int delete_module(const char *name, unsigned int flags);
 _syscall2(int, delete_module, const char *, name, unsigned int, flags)
 #endif
-- 
1.7.3.4



More information about the uClibc-cvs mailing list