~ubuntu-branches/ubuntu/maverick/vice/maverick

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2005-02-01 11:30:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050201113026-3eyakzsmmheclvjg
Tags: 1.16-1
* New upstream version
* Fixes crash on 64-bit architectures (closes: #287640)
* x128 working again (closes: #286767)
* Works fine with /dev/dsp in use (not in the main changelog, but tested
  on my local machine as working).  Presumably, this also takes care of
  the issue with dsp being held.  I'm not sure if this is because I'm
  testing it on a 2.6 kernel now -- if you are still having problems
  with /dev/dsp, please reopen the bugs. (closes: #152952, #207942)
* Don't kill Makefile.in on clean

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#include <os2.h>
42
42
 
43
43
#include <stdarg.h>
44
 
#include <signal.h>
45
44
#include <stdlib.h>
46
45
#include <stdio.h>
47
46
#include <string.h>
61
60
#include "log.h"
62
61
 
63
62
#include "ui.h"
 
63
#include "machine.h"    // machine-name
64
64
#include "signals.h"
65
65
#include "vsyncapi.h"
66
66
 
143
143
    DosGetInfoBlocks(&pTib, &pPib);
144
144
    DosQueryModuleName(pPib->pib_hmte, CCHMAXPATH, argv0);
145
145
 
146
 
    orig_workdir = (char*) getcwd(NULL, GET_PATH_MAX);
 
146
    orig_workdir = (char *)getcwd(NULL, CCHMAXPATH);
147
147
    atexit(restore_workdir);
148
148
 
149
149
    PM_open();
193
193
 
194
194
    if (!pathlist)
195
195
        pathlist = util_concat(emu_id,
196
 
                               FINDPATH_SEPARATOR_STRING, "DRIVES",
197
 
                               FINDPATH_SEPARATOR_STRING, "PRINTER",
 
196
                               ARCHDEP_FINDPATH_SEPARATOR_STRING, "DRIVES",
 
197
                               ARCHDEP_FINDPATH_SEPARATOR_STRING, "PRINTER",
198
198
                               NULL);
199
199
 
200
200
    return pathlist;
212
212
 
213
213
char *archdep_default_fliplist_file_name(void)
214
214
{
215
 
    return NULL;
 
215
    return util_concat(archdep_boot_path(), "\\vice2-", machine_name, ".vfl", NULL);
216
216
}
217
217
 
218
218
FILE *fLog=NULL;
272
272
#endif
273
273
}
274
274
 
275
 
#if !defined __X1541__ && !defined __PETCAT__
276
 
extern int trigger_shutdown;
277
 
#endif
278
 
 
279
 
static RETSIGTYPE break64(int sig)
280
 
{
281
 
    char *sigtxt;
282
 
    sigtxt = lib_msprintf("Received signal %d (%s). Vice will be closed.",
283
 
                          sig, sys_siglist[sig]);
284
 
    log_message(archlog, sigtxt);
285
 
#if !defined __X1541__ && !defined __PETCAT__
286
 
    WinMessageBox(HWND_DESKTOP, HWND_DESKTOP,
287
 
                  sigtxt, "VICE/2 Exception", 0, MB_OK);
288
 
    trigger_shutdown = TRUE;
289
 
 
290
 
#endif
291
 
    lib_free(sigtxt);
292
 
    exit (-1);
293
 
}
294
 
 
295
 
void archdep_setup_signals(int do_core_dumps)
296
 
{
297
 
    // at the place where it's called at the moment it's only valid
298
 
    // for the vice (simulation) thread
299
 
 
300
 
    signal(SIGINT, SIG_IGN);
301
 
 
302
 
    if (!do_core_dumps) {
303
 
        signal(SIGSEGV,  break64);
304
 
        signal(SIGILL,   break64);
305
 
        signal(SIGFPE,   break64);
306
 
        signal(SIGABRT,  break64);
307
 
        // signal(SIGINT,   break64);
308
 
        signal(SIGTERM,  break64);
309
 
        // signal(SIGUSR1,  break64);
310
 
        // signal(SIGUSR2,  break64);
311
 
        signal(SIGBREAK, break64);
312
 
#ifdef __IBMC__
313
 
        // signal(SIGUSR3,  break64);
314
 
#else
315
 
        signal(SIGPIPE,  break64);
316
 
        signal(SIGHUP,   break64);
317
 
        signal(SIGQUIT,  break64);
318
 
#endif
319
 
    }
320
 
}
321
 
 
322
275
int archdep_path_is_relative(const char *path)
323
276
{
324
277
    return !(isalpha(path[0]) && path[1] == ':' &&
545
498
        return -1;
546
499
 
547
500
    *len = statbuf.st_size;
548
 
    *isdir = S_ISDIR(statbuf.st_mode);
 
501
    *isdir = statbuf.st_mode&S_IFDIR;
549
502
 
550
503
    return 0;
551
504
}