diff options
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/crond.c | 4 | ||||
| -rw-r--r-- | miscutils/crontab.c | 2 | ||||
| -rw-r--r-- | miscutils/makedevs.c | 4 | ||||
| -rw-r--r-- | miscutils/nmeter.c | 14 |
4 files changed, 8 insertions, 16 deletions
diff --git a/miscutils/crond.c b/miscutils/crond.c index 623e8c359..eaed1ea69 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c | |||
| @@ -120,7 +120,7 @@ static void crondlog(const char *ctl, ...) | |||
| 120 | close(logfd); | 120 | close(logfd); |
| 121 | #if ENABLE_DEBUG_CROND_OPTION | 121 | #if ENABLE_DEBUG_CROND_OPTION |
| 122 | } else { | 122 | } else { |
| 123 | bb_perror_msg("Can't open log file"); | 123 | bb_perror_msg("can't open log file"); |
| 124 | #endif | 124 | #endif |
| 125 | } | 125 | } |
| 126 | } | 126 | } |
| @@ -924,7 +924,7 @@ static void RunJob(const char *user, CronLine * line) | |||
| 924 | line->cl_MailFlag = 1; | 924 | line->cl_MailFlag = 1; |
| 925 | fdprintf(mailFd, "To: %s\nSubject: cron: %s\n\n", user, | 925 | fdprintf(mailFd, "To: %s\nSubject: cron: %s\n\n", user, |
| 926 | line->cl_Shell); | 926 | line->cl_Shell); |
| 927 | line->cl_MailPos = lseek(mailFd, 0, 1); | 927 | line->cl_MailPos = lseek(mailFd, 0, SEEK_CUR); |
| 928 | } else { | 928 | } else { |
| 929 | crondlog("\024unable to create mail file user %s file %s, output to /dev/null\n", user, mailFile); | 929 | crondlog("\024unable to create mail file user %s file %s, output to /dev/null\n", user, mailFile); |
| 930 | } | 930 | } |
diff --git a/miscutils/crontab.c b/miscutils/crontab.c index a3bfd495d..6ae1b020c 100644 --- a/miscutils/crontab.c +++ b/miscutils/crontab.c | |||
| @@ -171,7 +171,7 @@ int crontab_main(int ac, char **av) | |||
| 171 | } | 171 | } |
| 172 | EditFile(caller, tmp); | 172 | EditFile(caller, tmp); |
| 173 | remove(tmp); | 173 | remove(tmp); |
| 174 | lseek(fd, 0L, 0); | 174 | lseek(fd, 0L, SEEK_SET); |
| 175 | repFd = fd; | 175 | repFd = fd; |
| 176 | } | 176 | } |
| 177 | option = REPLACE; | 177 | option = REPLACE; |
diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c index e4658010c..6ff5cc223 100644 --- a/miscutils/makedevs.c +++ b/miscutils/makedevs.c | |||
| @@ -187,7 +187,7 @@ int makedevs_main(int argc, char **argv) | |||
| 187 | sprintf(full_name_inc, "%s%d", full_name, i); | 187 | sprintf(full_name_inc, "%s%d", full_name, i); |
| 188 | rdev = (major << 8) + minor + (i * increment - start); | 188 | rdev = (major << 8) + minor + (i * increment - start); |
| 189 | if (mknod(full_name_inc, mode, rdev) == -1) { | 189 | if (mknod(full_name_inc, mode, rdev) == -1) { |
| 190 | bb_perror_msg("line %d: could not create node %s", linenum, full_name_inc); | 190 | bb_perror_msg("line %d: cannot create node %s", linenum, full_name_inc); |
| 191 | ret = EXIT_FAILURE; | 191 | ret = EXIT_FAILURE; |
| 192 | } | 192 | } |
| 193 | else if (chown(full_name_inc, uid, gid) == -1) { | 193 | else if (chown(full_name_inc, uid, gid) == -1) { |
| @@ -203,7 +203,7 @@ int makedevs_main(int argc, char **argv) | |||
| 203 | } else { | 203 | } else { |
| 204 | rdev = (major << 8) + minor; | 204 | rdev = (major << 8) + minor; |
| 205 | if (mknod(full_name, mode, rdev) == -1) { | 205 | if (mknod(full_name, mode, rdev) == -1) { |
| 206 | bb_perror_msg("line %d: could not create node %s", linenum, full_name); | 206 | bb_perror_msg("line %d: cannot create node %s", linenum, full_name); |
| 207 | ret = EXIT_FAILURE; | 207 | ret = EXIT_FAILURE; |
| 208 | } | 208 | } |
| 209 | else if (chown(full_name, uid, gid) == -1) { | 209 | else if (chown(full_name, uid, gid) == -1) { |
diff --git a/miscutils/nmeter.c b/miscutils/nmeter.c index e83de38ec..d71bd6add 100644 --- a/miscutils/nmeter.c +++ b/miscutils/nmeter.c | |||
| @@ -88,12 +88,7 @@ static void put_question_marks(int count) | |||
| 88 | 88 | ||
| 89 | static int readfile_z(char *buf, int sz, const char* fname) | 89 | static int readfile_z(char *buf, int sz, const char* fname) |
| 90 | { | 90 | { |
| 91 | int fd; | 91 | sz = open_read_close(fname, buf, sz-1); |
| 92 | fd = xopen(fname, O_RDONLY); | ||
| 93 | // We are not checking for short reads (valid only because | ||
| 94 | // we are reading /proc files) | ||
| 95 | sz = read(fd, buf, sz-1); | ||
| 96 | close(fd); | ||
| 97 | if (sz < 0) { | 92 | if (sz < 0) { |
| 98 | buf[0] = '\0'; | 93 | buf[0] = '\0'; |
| 99 | return 1; | 94 | return 1; |
| @@ -776,15 +771,12 @@ int nmeter_main(int argc, char* argv[]) | |||
| 776 | s_stat *last = NULL; | 771 | s_stat *last = NULL; |
| 777 | s_stat *s; | 772 | s_stat *s; |
| 778 | char *cur, *prev; | 773 | char *cur, *prev; |
| 779 | int fd; | ||
| 780 | 774 | ||
| 781 | if (argc != 2) | 775 | if (argc != 2) |
| 782 | bb_show_usage(); | 776 | bb_show_usage(); |
| 783 | 777 | ||
| 784 | fd = xopen("/proc/version", O_RDONLY); | 778 | if (open_read_close("/proc/version", buf, sizeof(buf)) > 0) |
| 785 | if (read(fd, buf, sizeof(buf)) > 0) | 779 | is26 = (strstr(buf, " 2.4.")==NULL); |
| 786 | is26 = (strstr(buf, "Linux version 2.4.")==NULL); | ||
| 787 | close(fd); | ||
| 788 | 780 | ||
| 789 | // Can use argv[1] directly, but this will mess up | 781 | // Can use argv[1] directly, but this will mess up |
| 790 | // parameters as seen by e.g. ps. Making a copy... | 782 | // parameters as seen by e.g. ps. Making a copy... |
