Fix daemon(), sched_setscheduler()

diff --git a/include/sched.h b/include/sched.h
index 5e61039..72f74a2 100644
--- a/include/sched.h
+++ b/include/sched.h
@@ -17,7 +17,7 @@
   int sched_priority;
 };
 
-__extern int sched_setschedule(pid_t, int, const struct sched_param *);
+__extern int sched_setscheduler(pid_t, int, const struct sched_param *);
 __extern int sched_yield(void);
 
 #endif /* _SCHED_H */
diff --git a/klibc/daemon.c b/klibc/daemon.c
index 7510b84..75d7146 100644
--- a/klibc/daemon.c
+++ b/klibc/daemon.c
@@ -18,10 +18,11 @@
 
   if ( !noclose ) {
     if ( (nullfd = open("/dev/null", O_RDWR)) < 0 ||
-	 dup2(nullfd, 0) ||
-	 dup2(nullfd, 1) ||
-	 dup2(nullfd, 2) )
+	 dup2(nullfd, 0) < 0 ||
+	 dup2(nullfd, 1) < 0 ||
+	 dup2(nullfd, 2) < 0 )
       return -1;
+    close(nullfd);
   }
   
   f = fork();
diff --git a/klibc/include/sched.h b/klibc/include/sched.h
index 5e61039..72f74a2 100644
--- a/klibc/include/sched.h
+++ b/klibc/include/sched.h
@@ -17,7 +17,7 @@
   int sched_priority;
 };
 
-__extern int sched_setschedule(pid_t, int, const struct sched_param *);
+__extern int sched_setscheduler(pid_t, int, const struct sched_param *);
 __extern int sched_yield(void);
 
 #endif /* _SCHED_H */