Permalink
Browse files

fd should be close

  • Loading branch information...
1 parent 516f07b commit 12715b1030b6a25a7c4628491e85bd6fe2e973d5 @bbiao bbiao committed Oct 26, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 system/core/toolbox/date.c
@@ -38,6 +38,8 @@ static void settime(char *s) {
ts.tv_sec = t;
ts.tv_nsec = 0;
ioctl(fd, ANDROID_ALARM_SET_RTC, &ts);
+
+ close(fd);
}
int date_main(int argc, char *argv[])
@@ -120,6 +122,7 @@ int date_main(int argc, char *argv[])
ts.tv_nsec = tv.tv_usec * 1000;
res = ioctl(fd, ANDROID_ALARM_SET_RTC, &ts);
//res = settimeofday(&tv, NULL);
+ close(fd);
if(res < 0) {
fprintf(stderr,"settimeofday failed %s\n", strerror(errno));
return 1;

0 comments on commit 12715b1

Please sign in to comment.