/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to plugins.d/usplash.c

* plugin-runner.c: Only space changes.
* plugins.d/mandos-client.c: - '' -
* plugins.d/password-prompt.c: - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
                                   EXIT_SUCCESS, malloc(), _exit() */
47
47
#include <stdlib.h>             /* getenv() */
48
48
#include <dirent.h>             /* opendir(), readdir(), closedir() */
49
 
#include <inttypes.h>           /* intmax_t, SCNdMAX */
50
49
#include <sys/stat.h>           /* struct stat, lstat(), S_ISLNK */
51
50
 
52
51
sig_atomic_t interrupted_by_signal = 0;
171
170
        proc_ent != NULL;
172
171
        proc_ent = readdir(proc_dir)){
173
172
      pid_t pid;
174
 
      {
175
 
        intmax_t tmpmax;
176
 
        int numchars;
177
 
        ret = sscanf(proc_ent->d_name, "%" SCNdMAX "%n", &tmpmax,
178
 
                     &numchars);
179
 
        if(ret < 1 or tmpmax != (pid_t)tmpmax
180
 
           or proc_ent->d_name[numchars] != '\0'){
181
 
          /* Not a process */
182
 
          continue;
183
 
        }
184
 
        pid = (pid_t)tmpmax;
 
173
      /* In the GNU C library, pid_t is always int */
 
174
      ret = sscanf(proc_ent->d_name, "%d", &pid);
 
175
      if(ret != 1){
 
176
        /* Not a process */
 
177
        continue;
185
178
      }
186
179
      /* Find the executable name by doing readlink() on the
187
180
         /proc/<pid>/exe link */