- Fix usage of setmode. it can fail due to malloc, so we should print the correct error message. Obtained-From: DragonFlyBSD Index: src/usr.bin/find/function.c =================================================================== --- src/usr.bin/find/function.c (revision 92) +++ src/usr.bin/find/function.c (revision 93) @@ -1196,8 +1196,14 @@ ++perm; } - if ((set = setmode(perm)) == NULL) - errx(1, "%s: %s: illegal mode string", option->name, perm); + errno = 0; + if ((set = setmode(perm)) == NULL) { + if (!errno) + errx(1, "%s: %s: illegal mode string", option->name, + perm); + else + err(1, "malloc failed"); + } new->m_data = getmode(set, 0); free(set);