02.06.2010

parent 56175a0b
...@@ -2679,7 +2679,7 @@ int parse_cmdline_option (struct uae_prefs *p, char c, char *arg) ...@@ -2679,7 +2679,7 @@ int parse_cmdline_option (struct uae_prefs *p, char c, char *arg)
case 'r': strncpy (p->romfile, arg, 255); p->romfile[255] = 0; break; case 'r': strncpy (p->romfile, arg, 255); p->romfile[255] = 0; break;
case 'K': strncpy (p->keyfile, arg, 255); p->keyfile[255] = 0; break; case 'K': strncpy (p->keyfile, arg, 255); p->keyfile[255] = 0; break;
case 'p': strncpy (p->prtname, arg, 255); p->prtname[255] = 0; break; case 'p': strncpy (p->prtname, arg, 255); p->prtname[255] = 0; break;
/* case 'I': strncpy (p->sername, arg, 255); p->sername[255] = 0; currprefs.use_serial = 1; break; */ case 'I': strncpy (p->sername, arg, 255); p->sername[255] = 0; currprefs.use_serial = 1; break;
case 'm': case 'M': parse_filesys_spec (c == 'M', arg); break; case 'm': case 'M': parse_filesys_spec (c == 'M', arg); break;
case 'W': parse_hardfile_spec (arg); break; case 'W': parse_hardfile_spec (arg); break;
case 'S': parse_sound_spec (p, arg); break; case 'S': parse_sound_spec (p, arg); break;
......
...@@ -3086,6 +3086,7 @@ void DSKLEN (uae_u16 v, unsigned int hpos) ...@@ -3086,6 +3086,7 @@ void DSKLEN (uae_u16 v, unsigned int hpos)
int motormask; int motormask;
DISK_update (hpos); DISK_update (hpos);
if ((v & 0x8000) && (dsklen & 0x8000)) { if ((v & 0x8000) && (dsklen & 0x8000)) {
dskdmaen = 2; dskdmaen = 2;
DISK_start (); DISK_start ();
......
...@@ -2897,7 +2897,7 @@ static void ...@@ -2897,7 +2897,7 @@ static void
put_long (info + 120, entrytype); put_long (info + 120, entrytype);
TRACE(("name=\"%s\"\n", xs)); TRACE(("name=\"%s\"\n", xs));
x2 = x = ua_fs (xs, -1); x = ua_fs (xs, -1);
n = strlen (x); n = strlen (x);
if (n > 106) if (n > 106)
n = 106; n = 106;
...@@ -2907,7 +2907,6 @@ static void ...@@ -2907,7 +2907,6 @@ static void
put_byte (info + i, *x), i++, x++; put_byte (info + i, *x), i++, x++;
while (i < 108) while (i < 108)
put_byte (info + i, 0), i++; put_byte (info + i, 0), i++;
xfree (x2);
#if defined TARGET_AMIGAOS && defined WORDS_BIGENDIAN #if defined TARGET_AMIGAOS && defined WORDS_BIGENDIAN
BPTR lock; BPTR lock;
...@@ -2943,7 +2942,7 @@ static void ...@@ -2943,7 +2942,7 @@ static void
xs = aino->comment; xs = aino->comment;
if (!xs) if (!xs)
xs= ""; xs= "";
x2 = x = ua_fs (xs, -1); x = ua_fs (xs, -1);
n = strlen (x); n = strlen (x);
if (n > 78) if (n > 78)
n = 78; n = 78;
...@@ -2952,7 +2951,6 @@ static void ...@@ -2952,7 +2951,6 @@ static void
put_byte (info + i, *x), i++, x++; put_byte (info + i, *x), i++, x++;
while (i < 224) while (i < 224)
put_byte (info + i, 0), i++; put_byte (info + i, 0), i++;
xfree (x2);
} }
PUT_PCK_RES1 (packet, DOS_TRUE); PUT_PCK_RES1 (packet, DOS_TRUE);
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -38,17 +38,17 @@ ...@@ -38,17 +38,17 @@
static long adjust_blocks (long blocks, int fromsize, int tosize) static long adjust_blocks (long blocks, int fromsize, int tosize)
{ {
if (tosize <= 0) if (tosize <= 0)
abort (); abort ();
if (fromsize <= 0) if (fromsize <= 0)
return -1; return -1;
if (fromsize == tosize) /* e.g., from 512 to 512 */ if (fromsize == tosize) /* e.g., from 512 to 512 */
return blocks; return blocks;
else if (fromsize > tosize) /* e.g., from 2048 to 512 */ else if (fromsize > tosize) /* e.g., from 2048 to 512 */
return blocks * (fromsize / tosize); return blocks * (fromsize / tosize);
else /* e.g., from 256 to 512 */ else /* e.g., from 256 to 512 */
return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize); return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
} }
#ifdef _WIN32 #ifdef _WIN32
...@@ -198,24 +198,28 @@ int get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp) ...@@ -198,24 +198,28 @@ int get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp)
Return the actual number of bytes read, zero for EOF, or negative Return the actual number of bytes read, zero for EOF, or negative
for an error. */ for an error. */
static int safe_read (int desc, char *ptr, int len) static int
safe_read (desc, ptr, len)
int desc;
char *ptr;
int len;
{ {
int n_chars; int n_chars;
if (len <= 0) if (len <= 0)
return len; return len;
#ifdef EINTR #ifdef EINTR
do do
{ {
n_chars = read (desc, ptr, len); n_chars = read (desc, ptr, len);
} }
while (n_chars < 0 && errno == EINTR); while (n_chars < 0 && errno == EINTR);
#else #else
n_chars = read (desc, ptr, len); n_chars = read (desc, ptr, len);
#endif #endif
return n_chars; return n_chars;
} }
/* Fill in the fields of FSP with information about space usage for /* Fill in the fields of FSP with information about space usage for
...@@ -226,33 +230,33 @@ static int safe_read (int desc, char *ptr, int len) ...@@ -226,33 +230,33 @@ static int safe_read (int desc, char *ptr, int len)
ERRNO is either a system error value, or zero if DISK is NULL ERRNO is either a system error value, or zero if DISK is NULL
on a system that requires a non-NULL value. */ on a system that requires a non-NULL value. */
int int
get_fs_usage (path, disk, fsp) get_fs_usage (path, disk, fsp)
const char *path; const char *path;
const char *disk; const char *disk;
struct fs_usage *fsp; struct fs_usage *fsp;
{ {
#ifdef STAT_STATFS3_OSF1 #ifdef STAT_STATFS3_OSF1
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_fsize, 512) # define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_fsize, 512)
struct statfs fsd; struct statfs fsd;
if (statfs (path, &fsd, sizeof (struct statfs)) != 0) if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
return -1; return -1;
#endif /* STAT_STATFS3_OSF1 */ #endif /* STAT_STATFS3_OSF1 */
#ifdef STAT_STATFS2_FS_DATA /* Ultrix */ #ifdef STAT_STATFS2_FS_DATA /* Ultrix */
# define CONVERT_BLOCKS(B) adjust_blocks ((B), 1024, 512) # define CONVERT_BLOCKS(B) adjust_blocks ((B), 1024, 512)
struct fs_data fsd; struct fs_data fsd;
if (statfs (path, &fsd) != 1) if (statfs (path, &fsd) != 1)
return -1; return -1;
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.fd_req.btot); fsp->fsu_blocks = CONVERT_BLOCKS (fsd.fd_req.btot);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.fd_req.bfree); fsp->fsu_bfree = CONVERT_BLOCKS (fsd.fd_req.bfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.fd_req.bfreen); fsp->fsu_bavail = CONVERT_BLOCKS (fsd.fd_req.bfreen);
fsp->fsu_files = fsd.fd_req.gtot; fsp->fsu_files = fsd.fd_req.gtot;
fsp->fsu_ffree = fsd.fd_req.gfree; fsp->fsu_ffree = fsd.fd_req.gfree;
#endif /* STAT_STATFS2_FS_DATA */ #endif /* STAT_STATFS2_FS_DATA */
...@@ -263,40 +267,40 @@ get_fs_usage (path, disk, fsp) ...@@ -263,40 +267,40 @@ get_fs_usage (path, disk, fsp)
# define CONVERT_BLOCKS(B) \ # define CONVERT_BLOCKS(B) \
adjust_blocks ((B), (fsd.s_type == Fs2b ? 1024 : 512), 512) adjust_blocks ((B), (fsd.s_type == Fs2b ? 1024 : 512), 512)
struct filsys fsd; struct filsys fsd;
int fd; int fd;
if (! disk) if (! disk)
{ {
errno = 0; errno = 0;
return -1; return -1;
} }
fd = open (disk, O_RDONLY); fd = open (disk, O_RDONLY);
if (fd < 0) if (fd < 0)
return -1; return -1;
lseek (fd, (long) SUPERBOFF, 0); lseek (fd, (long) SUPERBOFF, 0);
if (safe_read (fd, (char *) &fsd, sizeof fsd) != sizeof fsd) if (safe_read (fd, (char *) &fsd, sizeof fsd) != sizeof fsd)
{ {
close (fd); close (fd);
return -1; return -1;
} }
close (fd); close (fd);
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.s_fsize); fsp->fsu_blocks = CONVERT_BLOCKS (fsd.s_fsize);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.s_tfree); fsp->fsu_bfree = CONVERT_BLOCKS (fsd.s_tfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.s_tfree); fsp->fsu_bavail = CONVERT_BLOCKS (fsd.s_tfree);
fsp->fsu_files = (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1); fsp->fsu_files = (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1);
fsp->fsu_ffree = fsd.s_tinode; fsp->fsu_ffree = fsd.s_tinode;
#endif /* STAT_READ_FILSYS */ #endif /* STAT_READ_FILSYS */
#ifdef STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX */ #ifdef STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX */
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_bsize, 512) # define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_bsize, 512)
struct statfs fsd; struct statfs fsd;
if (statfs (path, &fsd) < 0) if (statfs (path, &fsd) < 0)
return -1; return -1;
# ifdef STATFS_TRUNCATES_BLOCK_COUNTS # ifdef STATFS_TRUNCATES_BLOCK_COUNTS
...@@ -305,12 +309,12 @@ get_fs_usage (path, disk, fsp) ...@@ -305,12 +309,12 @@ get_fs_usage (path, disk, fsp)
truncation, presumably without botching the 4.1.1 case, in which truncation, presumably without botching the 4.1.1 case, in which
the values are not truncated. The correct counts are stored in the values are not truncated. The correct counts are stored in
undocumented spare fields. */ undocumented spare fields. */
if (fsd.f_blocks == 0x1fffff && fsd.f_spare[0] > 0) if (fsd.f_blocks == 0x1fffff && fsd.f_spare[0] > 0)
{ {
fsd.f_blocks = fsd.f_spare[0]; fsd.f_blocks = fsd.f_spare[0];
fsd.f_bfree = fsd.f_spare[1]; fsd.f_bfree = fsd.f_spare[1];
fsd.f_bavail = fsd.f_spare[2]; fsd.f_bavail = fsd.f_spare[2];
} }
# endif /* STATFS_TRUNCATES_BLOCK_COUNTS */ # endif /* STATFS_TRUNCATES_BLOCK_COUNTS */
#endif /* STAT_STATFS2_BSIZE */ #endif /* STAT_STATFS2_BSIZE */
...@@ -318,10 +322,10 @@ get_fs_usage (path, disk, fsp) ...@@ -318,10 +322,10 @@ get_fs_usage (path, disk, fsp)
#ifdef STAT_STATFS2_FSIZE /* 4.4BSD */ #ifdef STAT_STATFS2_FSIZE /* 4.4BSD */
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_fsize, 512) # define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_fsize, 512)
struct statfs fsd; struct statfs fsd;
if (statfs (path, &fsd) < 0) if (statfs (path, &fsd) < 0)
return -1; return -1;
#endif /* STAT_STATFS2_FSIZE */ #endif /* STAT_STATFS2_FSIZE */
...@@ -340,10 +344,10 @@ get_fs_usage (path, disk, fsp) ...@@ -340,10 +344,10 @@ get_fs_usage (path, disk, fsp)
# endif # endif
# endif # endif
struct statfs fsd; struct statfs fsd;
if (statfs (path, &fsd, sizeof fsd, 0) < 0) if (statfs (path, &fsd, sizeof fsd, 0) < 0)
return -1; return -1;
/* Empirically, the block counts on most SVR3 and SVR3-derived /* Empirically, the block counts on most SVR3 and SVR3-derived
systems seem to always be in terms of 512-byte blocks, systems seem to always be in terms of 512-byte blocks,
no matter what value f_bsize has. */ no matter what value f_bsize has. */
...@@ -354,10 +358,10 @@ get_fs_usage (path, disk, fsp) ...@@ -354,10 +358,10 @@ get_fs_usage (path, disk, fsp)
# define CONVERT_BLOCKS(B) \ # define CONVERT_BLOCKS(B) \
adjust_blocks ((B), fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize, 512) adjust_blocks ((B), fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize, 512)
struct statvfs fsd; struct statvfs fsd;
if (statvfs (path, &fsd) < 0) if (statvfs (path, &fsd) < 0)
return -1; return -1;
/* f_frsize isn't guaranteed to be supported. */ /* f_frsize isn't guaranteed to be supported. */
#endif /* STAT_STATVFS */ #endif /* STAT_STATVFS */
...@@ -365,11 +369,11 @@ get_fs_usage (path, disk, fsp) ...@@ -365,11 +369,11 @@ get_fs_usage (path, disk, fsp)
#if !defined(STAT_STATFS2_FS_DATA) && !defined(STAT_READ_FILSYS) #if !defined(STAT_STATFS2_FS_DATA) && !defined(STAT_READ_FILSYS)
/* !Ultrix && !SVR2 */ /* !Ultrix && !SVR2 */
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks); fsp->fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree); fsp->fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail); fsp->fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail);
fsp->fsu_files = fsd.f_files; fsp->fsu_files = fsd.f_files;
fsp->fsu_ffree = fsd.f_ffree; fsp->fsu_ffree = fsd.f_ffree;
#endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */ #endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */
...@@ -380,27 +384,27 @@ get_fs_usage (path, disk, fsp) ...@@ -380,27 +384,27 @@ get_fs_usage (path, disk, fsp)
/* AIX PS/2 does not supply statfs. */ /* AIX PS/2 does not supply statfs. */
int int
statfs (path, fsb) statfs (path, fsb)
char *path; char *path;
struct statfs *fsb; struct statfs *fsb;
{ {
struct stat stats; struct stat stats;
struct dustat fsd; struct dustat fsd;
if (stat (path, &stats)) if (stat (path, &stats))
return -1; return -1;
if (dustat (stats.st_dev, 0, &fsd, sizeof (fsd))) if (dustat (stats.st_dev, 0, &fsd, sizeof (fsd)))
return -1; return -1;
fsb->f_type = 0; fsb->f_type = 0;
fsb->f_bsize = fsd.du_bsize; fsb->f_bsize = fsd.du_bsize;
fsb->f_blocks = fsd.du_fsize - fsd.du_isize; fsb->f_blocks = fsd.du_fsize - fsd.du_isize;
fsb->f_bfree = fsd.du_tfree; fsb->f_bfree = fsd.du_tfree;
fsb->f_bavail = fsd.du_tfree; fsb->f_bavail = fsd.du_tfree;
fsb->f_files = (fsd.du_isize - 2) * fsd.du_inopb; fsb->f_files = (fsd.du_isize - 2) * fsd.du_inopb;
fsb->f_ffree = fsd.du_tinode; fsb->f_ffree = fsd.du_tinode;
fsb->f_fsid.val[0] = fsd.du_site; fsb->f_fsid.val[0] = fsd.du_site;
fsb->f_fsid.val[1] = fsd.du_pckno; fsb->f_fsid.val[1] = fsd.du_pckno;
return 0; return 0;
} }
#endif /* _AIX && _I386 */ #endif /* _AIX && _I386 */
......
...@@ -445,7 +445,7 @@ configure:4344: $? = 0 ...@@ -445,7 +445,7 @@ configure:4344: $? = 0
configure:4344: result: yes configure:4344: result: yes
configure:4350: checking for _doprnt configure:4350: checking for _doprnt
configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccvIP0rc.o: In function `main': /tmp/ccQVX6ss.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt' /home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4350: $? = 1 configure:4350: $? = 1
...@@ -533,7 +533,7 @@ configure:4364: $? = 0 ...@@ -533,7 +533,7 @@ configure:4364: $? = 0
configure:4364: result: yes configure:4364: result: yes
configure:4364: checking for strcmpi configure:4364: checking for strcmpi
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccrvPcpr.o: In function `main': /tmp/ccML3BqH.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi' /home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4364: $? = 1 configure:4364: $? = 1
...@@ -613,7 +613,7 @@ configure: failed program was: ...@@ -613,7 +613,7 @@ configure: failed program was:
configure:4364: result: no configure:4364: result: no
configure:4364: checking for stricmp configure:4364: checking for stricmp
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccc5rzSv.o: In function `main': /tmp/ccLZtbQE.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp' /home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4364: $? = 1 configure:4364: $? = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment