summaryrefslogtreecommitdiffstats
path: root/init/builtins.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-02-04 10:25:09 -0800
committerElliott Hughes <enh@google.com>2015-02-04 10:25:09 -0800
commit24627906bfee8c4a9eede3deefd12365a78351bf (patch)
tree022000219c43e6c8e49dae701b3d2a7e60a93512 /init/builtins.cpp
parent798219e9e9137db272585f5dc5683df91ed5beb1 (diff)
downloadsystem_core-24627906bfee8c4a9eede3deefd12365a78351bf.zip
system_core-24627906bfee8c4a9eede3deefd12365a78351bf.tar.gz
system_core-24627906bfee8c4a9eede3deefd12365a78351bf.tar.bz2
Use TEMP_FAILURE_RETRY, always build bootchart.cpp.
Also switch the revision parsing over to sscanf as promised. I haven't done the hardware parsing because I don't yet know whether we actually need to keep the space-stripping code. Change-Id: Ic33378345cd515cb08d00c543acf44eb72673396
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r--init/builtins.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 6c4d9c4..9ead340 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -67,9 +67,7 @@ static int write_file(const char *path, const char *value)
len = strlen(value);
- do {
- ret = write(fd, value, len);
- } while (ret < 0 && errno == EINTR);
+ ret = TEMP_FAILURE_RETRY(write(fd, value, len));
close(fd);
if (ret < 0) {
@@ -132,7 +130,7 @@ static int __ifupdown(const char *interface, int up)
ifr.ifr_flags &= ~IFF_UP;
ret = ioctl(s, SIOCSIFFLAGS, &ifr);
-
+
done:
close(s);
return ret;
@@ -735,7 +733,7 @@ int do_sysclktz(int nargs, char **args)
return -1;
memset(&tz, 0, sizeof(tz));
- tz.tz_minuteswest = atoi(args[1]);
+ tz.tz_minuteswest = atoi(args[1]);
if (settimeofday(NULL, &tz))
return -1;
return 0;
@@ -768,7 +766,7 @@ int do_copy(int nargs, char **args)
if (nargs != 3)
return -1;
- if (stat(args[1], &info) < 0)
+ if (stat(args[1], &info) < 0)
return -1;
if ((fd1 = open(args[1], O_RDONLY|O_CLOEXEC)) < 0)