| 175 | | fd = Eopen(name, O_RDONLY, 0); |
|---|
| 176 | | len = Eread(fd, buf, sizeof(buf)-1); |
|---|
| 177 | | Eclose(fd); |
|---|
| 178 | | buf[len] = '\0'; |
|---|
| 179 | | if ((newline=strchr(buf, '\n')) != NULL) |
|---|
| 180 | | *newline = '\0'; |
|---|
| 181 | | |
|---|
| 182 | | if (!isNumber(buf, &val, true)) { |
|---|
| 183 | | WRITE_MSG(2, ENSC_WRAPPERS_PREFIX); |
|---|
| 184 | | WRITE_STR(2, name); |
|---|
| 185 | | WRITE_MSG(2, ": is not a number\n"); |
|---|
| 186 | | exit(1); |
|---|
| 187 | | } |
|---|
| 188 | | |
|---|
| 189 | | if (opt->offset != offsetof(struct vc_set_sched, set_mask)) |
|---|
| | 170 | if (opt->offset != offsetof(struct vc_set_sched, set_mask)) { |
|---|
| | 171 | int fd; |
|---|
| | 172 | char buf[128], *newline; |
|---|
| | 173 | signed long val; |
|---|
| | 174 | ssize_t len; |
|---|
| | 175 | |
|---|
| | 176 | fd = Eopen(name, O_RDONLY, 0); |
|---|
| | 177 | len = Eread(fd, buf, sizeof(buf)-1); |
|---|
| | 178 | Eclose(fd); |
|---|
| | 179 | buf[len] = '\0'; |
|---|
| | 180 | if ((newline=strchr(buf, '\n')) != NULL) |
|---|
| | 181 | *newline = '\0'; |
|---|
| | 182 | |
|---|
| | 183 | if (!isNumber(buf, &val, true)) { |
|---|
| | 184 | WRITE_MSG(2, ENSC_WRAPPERS_PREFIX); |
|---|
| | 185 | WRITE_STR(2, name); |
|---|
| | 186 | WRITE_MSG(2, ": is not a number\n"); |
|---|
| | 187 | exit(1); |
|---|
| | 188 | } |
|---|
| | 189 | |
|---|