Skip to content

Commit

Permalink
Merge pull request #6 from bbiao/master
Browse files Browse the repository at this point in the history
system/core/toolbox/date.c里打开的fd没有关闭
  • Loading branch information
dennise committed Oct 29, 2012
2 parents 516f07b + 12715b1 commit aaa4a74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions system/core/toolbox/date.c
Expand Up @@ -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[])
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit aaa4a74

Please sign in to comment.