~ubuntu-branches/ubuntu/wily/slurm-llnl/wily

« back to all changes in this revision

Viewing changes to src/plugins/proctrack/linuxproc/kill_tree.c

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2010-09-03 18:03:29 UTC
  • mfrom: (3.3.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100903180329-t0t8mtvk2eoctoso
Tags: 2.1.14-1
New upstream release 

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
#include <limits.h>
55
55
 
56
56
#include "slurm/slurm.h"
 
57
#include "slurm/slurm_errno.h"
 
58
#include "src/common/log.h"
57
59
#include "src/common/xmalloc.h"
58
60
#include "src/common/xstring.h"
59
 
#include "src/common/log.h"
60
61
#include "kill_tree.h"
61
62
 
62
63
typedef struct xpid_s {
163
164
 
164
165
        hashtbl = (xppid_t **)xmalloc(HASH_LEN * sizeof(xppid_t *));
165
166
 
 
167
        slurm_seterrno(0);
166
168
        while ((de = readdir(dir)) != NULL) {
167
169
                num = de->d_name;
168
170
                if ((num[0] < '0') || (num[0] > '9'))
169
171
                        continue;
170
172
                ret_l = strtol(num, &endptr, 10);
171
 
                if(errno == ERANGE) {
 
173
                if ((ret_l == LONG_MIN) || (ret_l == LONG_MAX) ||
 
174
                    (errno == ERANGE)) {
172
175
                        error("couldn't do a strtol on str %s(%d): %m",
173
176
                              num, ret_l);
174
177
                }