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 #ifdef HP_UX
48 extern void (*sigset(int, void (*)(__harg)))(__harg);
49 #endif
50
51 /*
52 * Workaround for NFS bug. Sometimes, when running 'chdir' on a remote
53 * dmake server, it fails with "Stale NFS file handle" error.
54 * The second attempt seems to work.
55 */
56 int
57 my_chdir(char * dir) {
58 int res = chdir(dir);
59 if (res != 0 && (errno == ESTALE || errno == EAGAIN)) {
60 /* Stale NFS file handle. Try again */
61 res = chdir(dir);
62 }
63 return res;
64 }
65
66
67 /*
68 * File table of contents
69 */
|
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 }
60 return res;
61 }
62
63
64 /*
65 * File table of contents
66 */
|