diff --git a/NEWS b/NEWS index 9cdf6448b041de07e8db4a7fdd8a36252eaff4da..3c6df7d923ce58cb45af639049b9701440ae8816 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,7 @@ documents those changes that are of interest to users and administrators. -- Prevent infinite loop in slurmstepd if execve fails. -- Prevent multiple responses to REQUEST_UPDATE_JOB_STEP message. -- Prevent possible deadlock in acct_gather_filesystem/lustre on error. + -- Make it so --mail-type=NONE didn't throw an invalid error. * Changes in Slurm 15.08.11 =========================== diff --git a/src/common/proc_args.c b/src/common/proc_args.c index a30d7cb316c591fd1c6bec1ba67d5bc7e6724eda..58b437b2e8957b945b4fd6c3d037c64cd66499eb 100644 --- a/src/common/proc_args.c +++ b/src/common/proc_args.c @@ -981,7 +981,7 @@ bool verify_hint(const char *arg, int *min_sockets, int *min_cores, uint16_t parse_mail_type(const char *arg) { char *buf, *tok, *save_ptr = NULL; - uint16_t rc = 0; + uint16_t rc = (uint16_t)INFINITE; if (!arg) return rc; diff --git a/src/salloc/opt.c b/src/salloc/opt.c index 062a39ec091e3fbd4cc1bfa158b6f804ed1ef783..2bb40a01383471537e3142425f076fd94e94eed0 100644 --- a/src/salloc/opt.c +++ b/src/salloc/opt.c @@ -1035,7 +1035,7 @@ void set_options(const int argc, char **argv) break; case LONG_OPT_MAIL_TYPE: opt.mail_type |= parse_mail_type(optarg); - if (opt.mail_type == 0) { + if (opt.mail_type == (uint16_t)INFINITE) { error("--mail-type=%s invalid", optarg); exit(error_exit); } diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c index d57e97d93d0f3bba6415e56f1ab60846562f27e0..81f51d8ad6a5c774099553af7f4c0b242a638d4d 100644 --- a/src/sbatch/opt.c +++ b/src/sbatch/opt.c @@ -1502,7 +1502,7 @@ static void _set_options(int argc, char **argv) break; case LONG_OPT_MAIL_TYPE: opt.mail_type |= parse_mail_type(optarg); - if (opt.mail_type == 0) { + if (opt.mail_type == (uint16_t)INFINITE) { error("--mail-type=%s invalid", optarg); exit(error_exit); } @@ -1889,7 +1889,7 @@ static void _set_pbs_options(int argc, char **argv) break; case 'm': opt.mail_type |= _parse_pbs_mail_type(optarg); - if ((opt.mail_type == 0) && strcasecmp(optarg, "n")) { + if (opt.mail_type == (uint16_t)INFINITE) { error("-m=%s invalid", optarg); exit(error_exit); } @@ -2686,7 +2686,7 @@ static bool _opt_verify(void) static uint16_t _parse_pbs_mail_type(const char *arg) { - uint16_t rc = 0; + uint16_t rc = (uint16_t)INFINITE; if (strchr(arg, 'b') || strchr(arg, 'B')) rc |= MAIL_JOB_BEGIN; @@ -2694,6 +2694,8 @@ static uint16_t _parse_pbs_mail_type(const char *arg) rc |= MAIL_JOB_END; if (strchr(arg, 'a') || strchr(arg, 'A')) rc |= MAIL_JOB_FAIL; + if (strchr(arg, 'n') || strchr(arg, 'N')) + rc = 0; return rc; } diff --git a/src/srun/libsrun/opt.c b/src/srun/libsrun/opt.c index e16e4ff6e47b788a6990fed30d969375cc640738..6404f55be590dde5552dd26ae5a15eb6dd4b5b8e 100644 --- a/src/srun/libsrun/opt.c +++ b/src/srun/libsrun/opt.c @@ -1474,7 +1474,7 @@ static void _set_options(const int argc, char **argv) break; case LONG_OPT_MAIL_TYPE: opt.mail_type |= parse_mail_type(optarg); - if (opt.mail_type == 0) { + if (opt.mail_type == (uint16_t)INFINITE) { error("--mail-type=%s invalid", optarg); exit(error_exit); }