From fe812ffde2d5eb31409b8945d50ec645aa57094c Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 20 Sep 2011 13:17:38 +0000 Subject: [PATCH] Simulation of large disks --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/sg-linux.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 2754e57..3a2aca8 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.08.29.213339" +#define Cdrskin_timestamP "2011.09.20.131602" diff --git a/libburn/sg-linux.c b/libburn/sg-linux.c index ba62878..78c182e 100644 --- a/libburn/sg-linux.c +++ b/libburn/sg-linux.c @@ -576,6 +576,7 @@ static int sg_open_drive_fd(char *fname, int scan_mode) O_NONBLOCK was already hardcoded in ata_ but not in sg_. There must be some reason for this. So O_NONBLOCK is default mode for both now. Disable on own risk. + ts B10904: O_NONBLOCK is prescribed by ts A70411 Switched to O_NDELAY for LKML statement 2007/4/11/141 by Alan Cox: "open() has side effects. The CD layer allows you to open @@ -1929,6 +1930,19 @@ int burn_os_stdio_capacity(char *path, off_t *bytes) *bytes = add_size + ((off_t) vfsbuf.f_frsize) * (off_t) vfsbuf.f_bavail; } + +#ifdef NIX +/* <<< */ + fprintf(stderr, "libburn_DEBUG: Faking 4.5 TB of disk space\n"); + *bytes = ((off_t) 2415919104) * (off_t) 2048; + if (*bytes / (off_t) 2048 > (off_t) 0x7ffffff0) { + *bytes = ((off_t) 0x7ffffff0) * (off_t) 2048; + fprintf(stderr, "libburn_DEBUG: Reducing disk space to 4 TB - 2 kB\n"); + } +/* <<< */ +#endif + + ret = 1; ex:; BURN_FREE_MEM(testpath);