Update of /cvsroot/winbash/winbash
In directory usw-pr-cvs1:/tmp/cvs-serv26055
Modified Files:
nojobs.c nt_io.c nt_types.h
Log Message:
Made files compile when JF_DEBUG is set
Index: nojobs.c
===================================================================
RCS file: /cvsroot/winbash/winbash/nojobs.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- nojobs.c 11 Mar 2002 14:32:12 -0000 1.4
+++ nojobs.c 15 Mar 2002 17:14:55 -0000 1.5
@@ -639,13 +639,13 @@
thr_args->var = var; /* how to copy this? */
#if defined(JF_DEBUG)
- fprintf(thr_main->stdfile[2], "nt_make_child, pipe_in = %d\n", pipe_in);
- fflush(thr_main->stdfile[2]);
+ fprintf(main_thread_stdfile[2], "nt_make_child, pipe_in = %d\n", pipe_in);
+ fflush(main_thread_stdfile[2]);
#endif
thr_args->pipe_in = (pipe_in == NO_PIPE ? NO_PIPE : dup (pipe_in));
#if defined(JF_DEBUG)
- fprintf(thr_main->stdfile[2], "nt_make_child, pipe_out = %d\n", pipe_out);
- fflush(thr_main->stdfile[2]);
+ fprintf(main_thread_stdfile[2], "nt_make_child, pipe_out = %d\n", pipe_out);
+ fflush(main_thread_stdfile[2]);
#endif
thr_args->pipe_out = (pipe_out == NO_PIPE ? NO_PIPE : dup (pipe_out));
thr_args->asynchronous = async_p;
@@ -662,8 +662,8 @@
{
int fd = dup (fds_to_close->bitmap[i]);
#if defined(JF_DEBUG)
- fprintf(thr_main->stdfile[2], "nt_make_child, fd to close = %d\n", fd);
- fflush(thr_main->stdfile[2]);
+ fprintf(main_thread_stdfile[2], "nt_make_child, fd to close = %d\n", fd);
+ fflush(main_thread_stdfile[2]);
#endif
if (fd >= new_bitmap_size)
@@ -691,8 +691,8 @@
if (fildes)
{
#if defined(JF_DEBUG)
- fprintf(thr_main->stdfile[2], "nt_make_child, fildes[0] = %d\n", fildes[0]);
- fflush(thr_main->stdfile[2]);
+ fprintf(main_thread_stdfile[2], "nt_make_child, fildes[0] = %d\n", fildes[0]);
+ fflush(main_thread_stdfile[2]);
#endif
if (fildes[0])
{
@@ -700,8 +700,8 @@
SET_CLOSE_ON_EXEC (fildes[0]);
}
#if defined(JF_DEBUG)
- fprintf(thr_main->stdfile[2], "nt_make_child, fildes[1] = %d\n", fildes[1]);
- fflush(thr_main->stdfile[2]);
+ fprintf(main_thread_stdfile[2], "nt_make_child, fildes[1] = %d\n", fildes[1]);
+ fflush(main_thread_stdfile[2]);
#endif
if (fildes[1])
{
Index: nt_io.c
===================================================================
RCS file: /cvsroot/winbash/winbash/nt_io.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- nt_io.c 12 Mar 2002 11:54:15 -0000 1.3
+++ nt_io.c 15 Mar 2002 17:14:55 -0000 1.4
@@ -73,8 +73,8 @@
{
int ret = _close (fd);
#if defined (JF_DEBUG)
- fprintf (thr_main->stdfile[2], "close (%d)\n", fd);
- fflush (thr_main->stdfile[2]);
+ fprintf (main_thread_stdfile[2], "%s:close (%d)\n", the_printed_command,fd);
+ fflush (main_thread_stdfile[2]);
#endif
return ret;
}
@@ -84,8 +84,8 @@
{
int new_fd = _dup (fd);
#if defined (JF_DEBUG)
- fprintf (thr_main->stdfile[2], "dup (%d) = %d\n", fd, new_fd);
- fflush (thr_main->stdfile[2]);
+ fprintf (main_thread_stdfile[2], "%s:dup (%d) = %d\n", the_printed_command, fd, new_fd);
+ fflush (main_thread_stdfile[2]);
#endif
return new_fd;
}
@@ -95,8 +95,8 @@
{
int ret = _dup2 (fd1, fd2);
#if defined (JF_DEBUG)
- fprintf (thr_main->stdfile[2], "dup2 (%d, %d)\n", fd1, fd2);
- fflush (thr_main->stdfile[2]);
+ fprintf (main_thread_stdfile[2], "%s:dup2 (%d, %d)\n", the_printed_command, fd1, fd2);
+ fflush (main_thread_stdfile[2]);
#endif
return ret;
}
@@ -135,8 +135,8 @@
*/
int ret = _pipe (filedes, 4096, mode);
#if defined (JF_DEBUG)
- fprintf (thr_main->stdfile[2], "pipe (%d, %d)\n", filedes[0], filedes[1]);
- fflush (thr_main->stdfile[2]);
+ fprintf (main_thread_stdfile[2], "%s:pipe (%d, %d)\n", the_printed_command, filedes[0], filedes[1]);
+ fflush (main_thread_stdfile[2]);
#endif
return ret;
}
@@ -215,8 +215,8 @@
_lseek (fd, 0L, SEEK_END);
#endif
#if defined (JF_DEBUG)
- fprintf (thr_main->stdfile[2], "open (%s) = %d\n", path, fd);
- fflush (thr_main->stdfile[2]);
+ fprintf (main_thread_stdfile[2], "%s:open (%s) = %d\n", the_printed_command, path, fd);
+ fflush (main_thread_stdfile[2]);
#endif
return fd;
}
@@ -237,8 +237,8 @@
_lseek (fd, 0L, SEEK_END);
#endif
#if defined (JF_DEBUG)
- fprintf (thr_main->stdfile[2], "open3 (%s) = %d\n", path, fd);
- fflush (thr_main->stdfile[2]);
+ fprintf (main_thread_stdfile[2], "%s:open3 (%s) = %d\n", the_printed_command,path, fd);
+ fflush (main_thread_stdfile[2]);
#endif
return fd;
}
@@ -247,8 +247,8 @@
FCLOSE (FILE *fp)
{
#if defined (JF_DEBUG)
- fprintf (thr_main->stdfile[2], "fclose (%d)\n", fp->_file);
- fflush (thr_main->stdfile[2]);
+ fprintf (main_thread_stdfile[2], "%s:fclose (%d)\n", the_printed_command, fp->_file);
+ fflush (main_thread_stdfile[2]);
#endif
fclose (fp);
}
@@ -265,8 +265,8 @@
#endif /* !BINARY_IO */
fp = _fsopen (strcmp (path, "/dev/null") ? path : "NUL", buf, _SH_DENYNO);
#if defined (JF_DEBUG)
- fprintf (thr_main->stdfile[2], "fopen (%s) = %d\n", path, fp->_file);
- fflush (thr_main->stdfile[2]);
+ fprintf (main_thread_stdfile[2], "%s:fopen (%s) = %d\n", the_printed_command, path, fp->_file);
+ fflush (main_thread_stdfile[2]);
#endif
return fp;
}
Index: nt_types.h
===================================================================
RCS file: /cvsroot/winbash/winbash/nt_types.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- nt_types.h 10 Mar 2002 21:45:13 -0000 1.2
+++ nt_types.h 15 Mar 2002 17:14:55 -0000 1.3
@@ -28,7 +28,8 @@
#include "general.h"
/* define it here because the windows include files bring in too much garbage */
-/* #include <windef.h> */
+//#include <windows.h>
+//#include <wincon.h>
typedef long DWORD;
typedef void* HANDLE;
#include "command.h"
@@ -97,6 +98,7 @@
this, in theory, will make it easier to merge changes
from the bash mainline into the windows port. */
#define stdfile thr_me->stdfile_
+#define main_thread_stdfile thr_main->stdfile_
#define last_made_pid thr_me->last_made_pid_
#define last_asynchronous_pid thr_me->last_asynchronous_pid_
|