char *cwd = xgetcwd();
for (;;) {
- char *next = path ? index(path, ':') : NULL;
+ char *next = path ? strchr(path, ':') : NULL;
int len = next ? next-path : strlen(path);
struct string_list *rnext;
struct stat st;
config MDEV
bool "mdev"
- default y
+ default n
help
usage: mdev [-s]
void mkswap_main(void)
{
- int fd = xopen(*toys.optargs, O_RDWR), pagesize = getpagesize();
+ int fd = xopen(*toys.optargs, O_RDWR), pagesize = sysconf(_SC_PAGE_SIZE);
off_t len = fdlength(fd);
unsigned int pages = (len/pagesize)-1, *swap = (unsigned int *)toybuf;
l = (unsigned long)d;
d -= l;
if (l) toys.exitval = sleep(l);
- if (!toys.exitval) toys.exitval = usleep((unsigned long)(d * 1000000));
+ if (!toys.exitval)
+ toys.exitval = nanosleep((unsigned long)(d * 1000000000));
}
}
// If they gave us a path, don't worry about $PATH or -a
- if (index(filename, '/')) {
+ if (strchr(filename, '/')) {
// Confirm it has the executable bit set, and it's not a directory.
if (!access(filename, X_OK)) {
struct stat st;