~ubuntu-branches/ubuntu/hardy/vice/hardy

« back to all changes in this revision

Viewing changes to src/arch/msdos/archdep.c

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2007-10-07 07:05:46 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071007070546-81yy0twlka7p2t0e
Tags: 1.22-1
* New upstream version (closes: #428280).
* Correct link to HTML documentation in manpage (closes: #409567).
* Fix most packaging mistakes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
209
209
}
210
210
 
211
211
int archdep_spawn(const char *name, char **argv,
212
 
                  const char *stdout_redir, const char *stderr_redir)
 
212
                  char **pstdout_redir, const char *stderr_redir)
213
213
{
214
214
    int new_stdout, new_stderr;
215
215
    int old_stdout_mode, old_stderr_mode;
216
216
    int old_stdout, old_stderr;
217
217
    int retval;
 
218
    char *stdout_redir = NULL;
 
219
 
 
220
    if (pstdout_redir != NULL) {
 
221
        if (*pstdout_redir == NULL)
 
222
            *pstdout_redir = archdep_tmpnam();
 
223
        stdout_redir = *pstdout_redir;
 
224
    }
218
225
 
219
226
    new_stdout = new_stderr = old_stdout = old_stderr = -1;
220
227
 
317
324
        return lib_stralloc(tmpnam(NULL));
318
325
}
319
326
 
 
327
FILE *archdep_mkstemp_fd(char **filename, const char *mode)
 
328
{
 
329
    char *tmp;
 
330
    FILE *fd;
 
331
 
 
332
    if (getenv("temp"))
 
333
        tmp = util_concat(getenv("temp"), tmpnam(NULL), NULL);
 
334
    else if (getenv("tmp"))
 
335
        tmp = util_concat(getenv("tmp"), tmpnam(NULL), NULL);
 
336
    else
 
337
        tmp = lib_stralloc(tmpnam(NULL));
 
338
 
 
339
    fd = fopen(tmp, mode);
 
340
 
 
341
    if (fd == NULL)
 
342
        return NULL;
 
343
 
 
344
    *filename = tmp;
 
345
 
 
346
    return fd;
 
347
}
 
348
 
320
349
int archdep_file_is_gzip(const char *name)
321
350
{
322
351
    size_t l = strlen(name);