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

« back to all changes in this revision

Viewing changes to src/ioutil.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:
40
40
#ifdef HAVE_IO_H
41
41
#include <io.h>
42
42
#endif
 
43
#ifdef HAVE_LIMITS_H
 
44
#include <limits.h>
 
45
#endif
43
46
#ifdef HAVE_FCNTL_H
44
47
#include <fcntl.h>
45
48
#endif
52
55
#ifdef HAVE_UNISTD_H
53
56
#include <unistd.h>
54
57
#endif
 
58
#ifdef __OS2__
 
59
#include "snippets/dirport.h"
 
60
#endif
55
61
 
56
62
#include "archdep.h"
57
63
#include "ioutil.h"
85
91
int ioutil_errno(unsigned int check)
86
92
{
87
93
    switch (check) {
 
94
#ifndef __OS2__
88
95
      case IOUTIL_ERRNO_EPERM:
89
96
        if (errno == EPERM)
90
97
            return 1;
91
98
        break;
 
99
#endif
92
100
      case IOUTIL_ERRNO_EEXIST:
93
101
        if (errno == EEXIST)
94
102
            return 1;
101
109
        if (errno == ENOENT)
102
110
            return 1;
103
111
        break;
 
112
#ifndef __OS2__
104
113
      case IOUTIL_ERRNO_ERANGE:
105
114
        if (errno == ERANGE)
106
115
            return 1;
107
116
        break;
 
117
#endif
108
118
      default:
109
119
        return 0;
110
120
    }
122
132
    return isatty(desc);
123
133
}
124
134
 
 
135
#ifndef PATH_MAX
 
136
#ifdef MAX_PATH
 
137
#define PATH_MAX MAX_PATH
 
138
#else
 
139
#define PATH_MAX 1024
 
140
#endif
 
141
#endif
 
142
 
 
143
int ioutil_maxpathlen(void)
 
144
{
 
145
    return PATH_MAX;
 
146
}
 
147
 
125
148
int ioutil_mkdir(const char *pathname, int mode)
126
149
{
127
150
    return archdep_mkdir(pathname, mode);
174
197
    DIR *dp;
175
198
    ioutil_dir_t *ioutil_dir;
176
199
 
177
 
    dp = opendir(path);
 
200
    dp = opendir((char*)path);
178
201
 
179
202
    if (dp == NULL)
180
203
        return NULL;