~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« 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: 2009-09-24 23:28:15 UTC
  • mfrom: (1.1.11 upstream) (3.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090924232815-enh65jn32q1ebg07
Tags: 2.0.5-1
* New upstream release 
* Changed dependecy from lib-mysqlclient15 to lib-mysqlclient 
* Added Default-Start for runlevel 2 and 4 and $remote_fs requirement in
  init.d scripts (Closes: #541252)
* Postinst checks for wrong runlevels 2 and 4 links
* Upgraded to standard version 3.8.3
* Add lintian overrides for missing slurm-llnl-configurator.html in doc
  base registration
* modified postrm scripts to ignore pkill return value in order to avoid
  postrm failure when no slurm process is running
* Checking for slurmctld.pid before cancelling running and pending
  jobs during package removal 

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *  Copyright (C) 2004 The Regents of the University of California.
6
6
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
7
7
 *  Written by Takao Hatazaki <takao.hatazaki@hp.com>
8
 
 *  LLNL-CODE-402394.
 
8
 *  CODE-OCEC-09-009. All rights reserved.
9
9
 *  
10
10
 *  This file is part of SLURM, a resource management program.
11
 
 *  For details, see <http://www.llnl.gov/linux/slurm/>.
 
11
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
12
 *  Please also read the included file: DISCLAIMER.
12
13
 *  
13
14
 *  SLURM is free software; you can redistribute it and/or modify it under
14
15
 *  the terms of the GNU General Public License as published by the Free
150
151
        char path[PATH_MAX], *endptr, *num, rbuf[1024];
151
152
        char myname[1024], cmd[1024];
152
153
        int fd;
153
 
        long pid, ppid;
 
154
        long pid, ppid, ret_l;
154
155
        xppid_t **hashtbl;
155
156
 
156
157
        if ((dir = opendir("/proc")) == NULL) {
164
165
 
165
166
        while ((de = readdir(dir)) != NULL) {
166
167
                num = de->d_name;
167
 
                strtol(num, &endptr, 10);
 
168
                ret_l = strtol(num, &endptr, 10);
 
169
                if(errno == ERANGE)
 
170
                        error("couldn't do a strtol on str %s(%d): %m",
 
171
                              num, ret_l);
 
172
 
168
173
                if (endptr == NULL || *endptr != 0)
169
174
                        continue;
170
175
                sprintf(path, "/proc/%s/stat", num);