Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/runit/chpst.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 92  enum { Line 92  enum {
92   OPT_2 = (1 << 20) * ENABLE_CHPST,   OPT_2 = (1 << 20) * ENABLE_CHPST,
93  };  };
94    
95  static void edir(const char *directory_name)  /* TODO: use recursive_action? */
96    static NOINLINE void edir(const char *directory_name)
97  {  {
98   int wdir;   int wdir;
99   DIR *dir;   DIR *dir;
# Line 101  static void edir(const char *directory_n Line 102  static void edir(const char *directory_n
102    
103   wdir = xopen(".", O_RDONLY | O_NDELAY);   wdir = xopen(".", O_RDONLY | O_NDELAY);
104   xchdir(directory_name);   xchdir(directory_name);
105   dir = opendir(".");   dir = xopendir(".");
  if (!dir)  
  bb_perror_msg_and_die("opendir %s", directory_name);  
106   for (;;) {   for (;;) {
107   char buf[256];   char buf[256];
108   char *tail;   char *tail;
# Line 200  int chpst_main(int argc UNUSED_PARAM, ch Line 199  int chpst_main(int argc UNUSED_PARAM, ch
199   // if yes -> getopt converts strings to numbers for us   // if yes -> getopt converts strings to numbers for us
200   opt_complementary = "-1:a+:c+:d+:f+:l+:m+:o+:p+:r+:s+:t+";   opt_complementary = "-1:a+:c+:d+:f+:l+:m+:o+:p+:r+:s+:t+";
201   opt = getopt32(argv, "+a:c:d:f:l:m:o:p:r:s:t:u:U:e:"   opt = getopt32(argv, "+a:c:d:f:l:m:o:p:r:s:t:u:U:e:"
202   USE_CHPST("/:n:vP012"),   IF_CHPST("/:n:vP012"),
203   &limita, &limitc, &limitd, &limitf, &limitl,   &limita, &limitc, &limitd, &limitf, &limitl,
204   &limitm, &limito, &limitp, &limitr, &limits, &limitt,   &limitm, &limito, &limitp, &limitr, &limits, &limitt,
205   &set_user, &env_user, &env_dir   &set_user, &env_user, &env_dir
206   USE_CHPST(, &root, &nicestr));   IF_CHPST(, &root, &nicestr));
207   argv += optind;   argv += optind;
208   if (opt & OPT_m) { // -m means -asld   if (opt & OPT_m) { // -m means -asld
209   limita = limits = limitl = limitd = limitm;   limita = limits = limitl = limitd = limitm;

Legend:
Removed from v.983  
changed lines
  Added in v.984