Print this page
make: ship the Joyent patch to enable parallel make (originally from rm)


  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 
  27 /*
  28  *      mksh.cc
  29  *
  30  *      Execute the command(s) of one Make or DMake rule
  31  */
  32 
  33 /*
  34  * Included files
  35  */
  36 #if defined(TEAMWARE_MAKE_CMN) || defined(MAKETOOL) /* tolik */
  37 #       include <avo/util.h>
  38 #endif
  39 
  40 #include <mksh/dosys.h>           /* redirect_io() */
  41 #include <mksh/misc.h>            /* retmem() */
  42 #include <mksh/mksh.h>
  43 #include <mksdmsi18n/mksdmsi18n.h>
  44 #include <errno.h>
  45 #include <signal.h>
  46 
  47 
  48 /*
  49  * Workaround for NFS bug. Sometimes, when running 'chdir' on a remote
  50  * dmake server, it fails with "Stale NFS file handle" error.
  51  * The second attempt seems to work.
  52  */
  53 int
  54 my_chdir(char * dir) {
  55         int res = chdir(dir);
  56         if (res != 0 && (errno == ESTALE || errno == EAGAIN)) {
  57                 /* Stale NFS file handle. Try again */
  58                 res = chdir(dir);
  59         }




  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 
  27 /*
  28  *      mksh.cc
  29  *
  30  *      Execute the command(s) of one Make or DMake rule
  31  */
  32 
  33 /*
  34  * Included files
  35  */




  36 #include <mksh/dosys.h>           /* redirect_io() */
  37 #include <mksh/misc.h>            /* retmem() */
  38 #include <mksh/mksh.h>
  39 #include <mksdmsi18n/mksdmsi18n.h>
  40 #include <errno.h>
  41 #include <signal.h>
  42 
  43 
  44 /*
  45  * Workaround for NFS bug. Sometimes, when running 'chdir' on a remote
  46  * dmake server, it fails with "Stale NFS file handle" error.
  47  * The second attempt seems to work.
  48  */
  49 int
  50 my_chdir(char * dir) {
  51         int res = chdir(dir);
  52         if (res != 0 && (errno == ESTALE || errno == EAGAIN)) {
  53                 /* Stale NFS file handle. Try again */
  54                 res = chdir(dir);
  55         }