02.06.2010

parent 56175a0b
......@@ -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 'K': strncpy (p->keyfile, arg, 255); p->keyfile[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 'W': parse_hardfile_spec (arg); break;
case 'S': parse_sound_spec (p, arg); break;
......
......@@ -3086,6 +3086,7 @@ void DSKLEN (uae_u16 v, unsigned int hpos)
int motormask;
DISK_update (hpos);
if ((v & 0x8000) && (dsklen & 0x8000)) {
dskdmaen = 2;
DISK_start ();
......
......@@ -2897,7 +2897,7 @@ static void
put_long (info + 120, entrytype);
TRACE(("name=\"%s\"\n", xs));
x2 = x = ua_fs (xs, -1);
x = ua_fs (xs, -1);
n = strlen (x);
if (n > 106)
n = 106;
......@@ -2907,7 +2907,6 @@ static void
put_byte (info + i, *x), i++, x++;
while (i < 108)
put_byte (info + i, 0), i++;
xfree (x2);
#if defined TARGET_AMIGAOS && defined WORDS_BIGENDIAN
BPTR lock;
......@@ -2943,7 +2942,7 @@ static void
xs = aino->comment;
if (!xs)
xs= "";
x2 = x = ua_fs (xs, -1);
x = ua_fs (xs, -1);
n = strlen (x);
if (n > 78)
n = 78;
......@@ -2952,7 +2951,6 @@ static void
put_byte (info + i, *x), i++, x++;
while (i < 224)
put_byte (info + i, 0), i++;
xfree (x2);
}
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 @@
static long adjust_blocks (long blocks, int fromsize, int tosize)
{
if (tosize <= 0)
abort ();
if (fromsize <= 0)
return -1;
if (fromsize == tosize) /* e.g., from 512 to 512 */
return blocks;
else if (fromsize > tosize) /* e.g., from 2048 to 512 */
return blocks * (fromsize / tosize);
else /* e.g., from 256 to 512 */
return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
if (tosize <= 0)
abort ();
if (fromsize <= 0)
return -1;
if (fromsize == tosize) /* e.g., from 512 to 512 */
return blocks;
else if (fromsize > tosize) /* e.g., from 2048 to 512 */
return blocks * (fromsize / tosize);
else /* e.g., from 256 to 512 */
return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
}
#ifdef _WIN32
......@@ -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
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)
return len;
if (len <= 0)
return len;
#ifdef EINTR
do
{
n_chars = read (desc, ptr, len);
}
while (n_chars < 0 && errno == EINTR);
do
{
n_chars = read (desc, ptr, len);
}
while (n_chars < 0 && errno == EINTR);
#else
n_chars = read (desc, ptr, len);
n_chars = read (desc, ptr, len);
#endif
return n_chars;
return n_chars;
}
/* 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)
ERRNO is either a system error value, or zero if DISK is NULL
on a system that requires a non-NULL value. */
int
get_fs_usage (path, disk, fsp)
const char *path;
const char *disk;
get_fs_usage (path, disk, fsp)
const char *path;
const char *disk;
struct fs_usage *fsp;
{
#ifdef STAT_STATFS3_OSF1
# 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)
return -1;
if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
return -1;
#endif /* STAT_STATFS3_OSF1 */
#ifdef STAT_STATFS2_FS_DATA /* Ultrix */
# define CONVERT_BLOCKS(B) adjust_blocks ((B), 1024, 512)
struct fs_data fsd;
struct fs_data fsd;
if (statfs (path, &fsd) != 1)
return -1;
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.fd_req.btot);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.fd_req.bfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.fd_req.bfreen);
fsp->fsu_files = fsd.fd_req.gtot;
fsp->fsu_ffree = fsd.fd_req.gfree;
if (statfs (path, &fsd) != 1)
return -1;
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.fd_req.btot);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.fd_req.bfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.fd_req.bfreen);
fsp->fsu_files = fsd.fd_req.gtot;
fsp->fsu_ffree = fsd.fd_req.gfree;
#endif /* STAT_STATFS2_FS_DATA */
......@@ -263,40 +267,40 @@ get_fs_usage (path, disk, fsp)
# define CONVERT_BLOCKS(B) \
adjust_blocks ((B), (fsd.s_type == Fs2b ? 1024 : 512), 512)
struct filsys fsd;
int fd;
struct filsys fsd;
int fd;
if (! disk)
{
errno = 0;
return -1;
}
if (! disk)
{
errno = 0;
return -1;
}
fd = open (disk, O_RDONLY);
if (fd < 0)
return -1;
lseek (fd, (long) SUPERBOFF, 0);
if (safe_read (fd, (char *) &fsd, sizeof fsd) != sizeof fsd)
{
close (fd);
return -1;
}
close (fd);
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.s_fsize);
fsp->fsu_bfree = 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_ffree = fsd.s_tinode;
fd = open (disk, O_RDONLY);
if (fd < 0)
return -1;
lseek (fd, (long) SUPERBOFF, 0);
if (safe_read (fd, (char *) &fsd, sizeof fsd) != sizeof fsd)
{
close (fd);
return -1;
}
close (fd);
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.s_fsize);
fsp->fsu_bfree = 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_ffree = fsd.s_tinode;
#endif /* STAT_READ_FILSYS */
#ifdef STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX */
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_bsize, 512)
struct statfs fsd;
struct statfs fsd;
if (statfs (path, &fsd) < 0)
return -1;
if (statfs (path, &fsd) < 0)
return -1;
# ifdef STATFS_TRUNCATES_BLOCK_COUNTS
......@@ -305,12 +309,12 @@ get_fs_usage (path, disk, fsp)
truncation, presumably without botching the 4.1.1 case, in which
the values are not truncated. The correct counts are stored in
undocumented spare fields. */
if (fsd.f_blocks == 0x1fffff && fsd.f_spare[0] > 0)
{
fsd.f_blocks = fsd.f_spare[0];
fsd.f_bfree = fsd.f_spare[1];
fsd.f_bavail = fsd.f_spare[2];
}
if (fsd.f_blocks == 0x1fffff && fsd.f_spare[0] > 0)
{
fsd.f_blocks = fsd.f_spare[0];
fsd.f_bfree = fsd.f_spare[1];
fsd.f_bavail = fsd.f_spare[2];
}
# endif /* STATFS_TRUNCATES_BLOCK_COUNTS */
#endif /* STAT_STATFS2_BSIZE */
......@@ -318,10 +322,10 @@ get_fs_usage (path, disk, fsp)
#ifdef STAT_STATFS2_FSIZE /* 4.4BSD */
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_fsize, 512)
struct statfs fsd;
struct statfs fsd;
if (statfs (path, &fsd) < 0)
return -1;
if (statfs (path, &fsd) < 0)
return -1;
#endif /* STAT_STATFS2_FSIZE */
......@@ -340,10 +344,10 @@ get_fs_usage (path, disk, fsp)
# endif
# endif
struct statfs fsd;
struct statfs fsd;
if (statfs (path, &fsd, sizeof fsd, 0) < 0)
return -1;
if (statfs (path, &fsd, sizeof fsd, 0) < 0)
return -1;
/* Empirically, the block counts on most SVR3 and SVR3-derived
systems seem to always be in terms of 512-byte blocks,
no matter what value f_bsize has. */
......@@ -354,10 +358,10 @@ get_fs_usage (path, disk, fsp)
# define CONVERT_BLOCKS(B) \
adjust_blocks ((B), fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize, 512)
struct statvfs fsd;
struct statvfs fsd;
if (statvfs (path, &fsd) < 0)
return -1;
if (statvfs (path, &fsd) < 0)
return -1;
/* f_frsize isn't guaranteed to be supported. */
#endif /* STAT_STATVFS */
......@@ -365,11 +369,11 @@ get_fs_usage (path, disk, fsp)
#if !defined(STAT_STATFS2_FS_DATA) && !defined(STAT_READ_FILSYS)
/* !Ultrix && !SVR2 */
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail);
fsp->fsu_files = fsd.f_files;
fsp->fsu_ffree = fsd.f_ffree;
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail);
fsp->fsu_files = fsd.f_files;
fsp->fsu_ffree = fsd.f_ffree;
#endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */
......@@ -380,27 +384,27 @@ get_fs_usage (path, disk, fsp)
/* AIX PS/2 does not supply statfs. */
int
statfs (path, fsb)
char *path;
struct statfs *fsb;
statfs (path, fsb)
char *path;
struct statfs *fsb;
{
struct stat stats;
struct dustat fsd;
if (stat (path, &stats))
return -1;
if (dustat (stats.st_dev, 0, &fsd, sizeof (fsd)))
return -1;
fsb->f_type = 0;
fsb->f_bsize = fsd.du_bsize;
fsb->f_blocks = fsd.du_fsize - fsd.du_isize;
fsb->f_bfree = fsd.du_tfree;
fsb->f_bavail = fsd.du_tfree;
fsb->f_files = (fsd.du_isize - 2) * fsd.du_inopb;
fsb->f_ffree = fsd.du_tinode;
fsb->f_fsid.val[0] = fsd.du_site;
fsb->f_fsid.val[1] = fsd.du_pckno;
return 0;
struct stat stats;
struct dustat fsd;
if (stat (path, &stats))
return -1;
if (dustat (stats.st_dev, 0, &fsd, sizeof (fsd)))
return -1;
fsb->f_type = 0;
fsb->f_bsize = fsd.du_bsize;
fsb->f_blocks = fsd.du_fsize - fsd.du_isize;
fsb->f_bfree = fsd.du_tfree;
fsb->f_bavail = fsd.du_tfree;
fsb->f_files = (fsd.du_isize - 2) * fsd.du_inopb;
fsb->f_ffree = fsd.du_tinode;
fsb->f_fsid.val[0] = fsd.du_site;
fsb->f_fsid.val[1] = fsd.du_pckno;
return 0;
}
#endif /* _AIX && _I386 */
......
......@@ -445,7 +445,7 @@ configure:4344: $? = 0
configure:4344: result: yes
configure:4350: checking for _doprnt
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'
collect2: ld returned 1 exit status
configure:4350: $? = 1
......@@ -533,7 +533,7 @@ configure:4364: $? = 0
configure:4364: result: yes
configure:4364: checking for strcmpi
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'
collect2: ld returned 1 exit status
configure:4364: $? = 1
......@@ -613,7 +613,7 @@ configure: failed program was:
configure:4364: result: no
configure:4364: checking for stricmp
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'
collect2: ld returned 1 exit status
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