~ubuntu-branches/ubuntu/trusty/pvm/trusty-proposed

« back to all changes in this revision

Viewing changes to hoster/pvmwinrexec.c

  • Committer: Bazaar Package Importer
  • Author(s): Steinar H. Gunderson
  • Date: 2006-08-09 00:00:40 UTC
  • mfrom: (2.1.5 dapper)
  • Revision ID: james.westby@ubuntu.com-20060809000040-16kh33tmxx2em716
Tags: 3.4.5-7
Build with SHELL=/bin/bash in debian/rules; fixes FTBFS when /bin/sh
isn't bash. (Closes: #379543)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
static char rcsid[] =
3
 
        "$Id: pvmwinrexec.c,v 1.3 1998/11/20 19:47:48 pvmsrc Exp $";
 
3
        "$Id: pvmwinrexec.c,v 1.4 2003/02/04 20:06:31 pvmsrc Exp $";
4
4
 
5
5
/*
6
6
 *         PVM version 3.4:  Parallel Virtual Machine System
46
46
 
47
47
#include <signal.h>
48
48
 
49
 
static void PassOutputThread(void);
50
 
static void PassErrorThread(void);
 
49
static DWORD WINAPI PassOutputThread(LPVOID);
 
50
static DWORD WINAPI PassErrorThread(LPVOID);
51
51
 
52
52
HANDLE hStdIn, hStdOut, hStdErr;
53
53
 
202
202
static HANDLE PassOutput()
203
203
{
204
204
        HANDLE id;
 
205
        DWORD threadId;
 
206
        
205
207
 
206
 
        id = (HANDLE) _beginthread(PassOutputThread, 0, NULL);
 
208
        id = (HANDLE)CreateThread(NULL,0,PassOutputThread, NULL, 0, &threadId);
207
209
        if ((long)id == -1) {
208
210
                fprintf(stderr, "Could not start output passing thread: error = %lu\n", GetLastError());
209
211
                exit(1);
212
214
}
213
215
 
214
216
extern int debugmask;
215
 
static void PassOutputThread(void)
 
217
static DWORD WINAPI PassOutputThread(LPVOID nothing)
216
218
{
217
219
 
218
220
 
255
257
        free(buf);
256
258
final:
257
259
        ExitThread(retval);
 
260
        return retval;
258
261
 
259
262
}
260
263
 
262
265
static HANDLE PassError()
263
266
{
264
267
        HANDLE id;
 
268
        DWORD threadId;
 
269
        
265
270
 
266
 
        id = (HANDLE) _beginthread(PassErrorThread, 0, NULL);
 
271
        id = (HANDLE)CreateThread(NULL,0,PassErrorThread, NULL, 0, &threadId);
267
272
        if ((long)id == -1) {
268
273
                fprintf(stderr, "Could not start error passing thread: error = %lu\n", GetLastError());
269
274
                exit(1);
271
276
        return id;
272
277
}
273
278
 
274
 
static void PassErrorThread(void)
 
279
static DWORD WINAPI PassErrorThread(LPVOID nothing)
275
280
{
276
281
        
277
282
        DWORD retval = 0;
304
309
 
305
310
 
306
311
        ExitThread(retval);
 
312
        return retval;
307
313
 
308
314
}
309
315