Back to index

nordugrid-arc-nox  1.1.0~rc6
Functions
gm_kick.cpp File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "jobs/users.h"
#include "jobs/commfifo.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 13 of file gm_kick.cpp.

                                {
  // All input arguments are supposed to contain path to status files
  for(int n = 1;n<argc;n++) {
    struct stat st;
    if(lstat(argv[n],&st) != 0) continue;
    if(!S_ISREG(st.st_mode)) continue;
    JobUser user(st.st_uid);
    if(!user.is_valid()) continue;
    std::string path = argv[n];
    if(path[0] != '/') {
      char buf[BUFSIZ];
      if(getcwd(buf,BUFSIZ) != NULL) path=std::string(buf)+"/"+path;
    };
    std::string::size_type l = path.rfind('/');
    if(l == std::string::npos) continue;
    path.resize(l); 
    user.SetControlDir(path);
    SignalFIFO(user);
  };
  return 0;
}

Here is the call graph for this function: