summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/Makefile2
-rw-r--r--mdk-stage1/NEWS4
-rw-r--r--mdk-stage1/init.c27
-rw-r--r--mdk-stage1/nfsmount.c9
-rw-r--r--mdk-stage1/ppp/pppd/tdb.c24
-rw-r--r--mdk-stage1/ppp/pppd/utils.c4
-rw-r--r--mdk-stage1/stdio-frontend.c13
7 files changed, 36 insertions, 47 deletions
diff --git a/mdk-stage1/Makefile b/mdk-stage1/Makefile
index 8d0191033..dbe8f0f46 100644
--- a/mdk-stage1/Makefile
+++ b/mdk-stage1/Makefile
@@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-VERSION=1.51
+VERSION=1.52
PRODUCT=drakx-installer-binaries
#
diff --git a/mdk-stage1/NEWS b/mdk-stage1/NEWS
index 1fb9f6fc1..99016e833 100644
--- a/mdk-stage1/NEWS
+++ b/mdk-stage1/NEWS
@@ -1,3 +1,7 @@
+1.52:
+- fix build with gcc-4.6.2
+ * fixes -Werror=unused-but-set-variable
+
1.51:
- sync with kernel-3.1.0-1.mga2
* add hid devices:
diff --git a/mdk-stage1/init.c b/mdk-stage1/init.c
index 1d5841610..c4dacd944 100644
--- a/mdk-stage1/init.c
+++ b/mdk-stage1/init.c
@@ -116,20 +116,20 @@ void print_int_init(int fd, int i)
char buf[10];
char * chptr = buf + 9;
int j = 0;
-
+
if (i < 0)
{
write(1, "-", 1);
i = -1 * i;
}
-
+
while (i)
{
*chptr-- = '0' + (i % 10);
j++;
i = i / 10;
}
-
+
write(fd, chptr + 1, j);
}
@@ -176,7 +176,7 @@ void doklog()
close(1);
close(2);
}
-
+
out = open("/dev/tty4", O_WRONLY, 0);
if (out < 0)
print_warning("couldn't open tty for syslog -- still using /tmp/syslog\n");
@@ -218,7 +218,7 @@ void doklog()
if (sock >= 0)
FD_SET(sock, &readset);
FD_SET(in, &readset);
-
+
i = select(20, &readset, NULL, NULL, NULL);
if (i <= 0)
continue;
@@ -305,10 +305,9 @@ void unmount_filesystems(void)
struct filesystem fs[500];
int numfs = 0;
int i, nb;
- int disallow_eject = 0;
printf("unmounting filesystems...\n");
-
+
fd = open("/proc/mounts", O_RDONLY, 0);
if (fd < 1) {
print_error("failed to open /proc/mounts");
@@ -335,8 +334,6 @@ void unmount_filesystems(void)
*p++ = '\0';
while (*p != '\n') p++;
p++;
- if (!strcmp(fs[numfs].fs, "nfs"))
- disallow_eject = 1;
if (strcmp(fs[numfs].name, "/")
&& !strstr(fs[numfs].dev, "ram")
&& strcmp(fs[numfs].name, "/dev")
@@ -360,14 +357,14 @@ void unmount_filesystems(void)
}
}
} while (nb);
-
+
for (i = nb = 0; i < numfs; i++)
if (fs[i].mounted) {
printf("\tumount failed: %s\n", fs[i].name);
if (strcmp(fs[i].fs, "ext3") == 0) nb++; /* don't count not-ext3 umount failed */
}
-
+
if (nb) {
printf("failed to umount some filesystems\n");
select(0, NULL, NULL, NULL, NULL);
@@ -422,7 +419,7 @@ int main(int argc, char **argv)
if (mount("none", "/sys", "sysfs", 0, NULL))
fatal_error("Unable to mount sysfs filesystem");
}
-
+
/* ignore Control-C and keyboard stop signals */
signal(SIGINT, SIG_IGN);
@@ -432,13 +429,13 @@ int main(int argc, char **argv)
fd = open("/dev/console", O_RDWR, 0);
if (fd < 0)
fatal_error("failed to open /dev/console");
-
+
dup2(fd, 0);
dup2(fd, 1);
dup2(fd, 2);
close(fd);
}
-
+
/* I set me up as session leader (probably not necessary?) */
setsid();
@@ -458,7 +455,7 @@ int main(int argc, char **argv)
/* Go into normal init mode - keep going, and then do a orderly shutdown
when:
-
+
1) install exits
2) we receive a SIGHUP
*/
diff --git a/mdk-stage1/nfsmount.c b/mdk-stage1/nfsmount.c
index 85ffb25c1..02d7ddba8 100644
--- a/mdk-stage1/nfsmount.c
+++ b/mdk-stage1/nfsmount.c
@@ -284,7 +284,6 @@ int nfsmount_prepare(const char *spec, char **mount_opts)
enum clnt_stat clnt_stat;
static struct nfs_mount_data data;
int nfs_mount_version;
- int val;
struct sockaddr_in server_addr;
struct sockaddr_in mount_server_addr;
struct pmap *pm_mnt;
@@ -297,12 +296,11 @@ int nfsmount_prepare(const char *spec, char **mount_opts)
char *s;
int port, mountport, proto, soft, intr;
int posix, nocto, noac, broken_suid, nolock;
- int retry, tcp;
+ int tcp;
int mountprog, mountvers, nfsprog, nfsvers;
int retval;
time_t t;
time_t prevt;
- time_t timeout;
nfs_mount_version = find_kernel_nfs_mount_version();
@@ -361,7 +359,6 @@ int nfsmount_prepare(const char *spec, char **mount_opts)
nolock = 1;
broken_suid = 0;
noac = 0;
- retry = 10000; /* 10000 minutes ~ 1 week */
tcp = 0;
mountprog = MOUNTPROG;
@@ -469,10 +466,8 @@ retry_mount:
retry_timeout.tv_usec = 0;
total_timeout.tv_sec = 20;
total_timeout.tv_usec = 0;
- timeout = time(NULL) + 60 * retry;
prevt = 0;
t = 30;
- val = 1;
/* be careful not to use too many CPU cycles */
@@ -677,7 +672,7 @@ retry_mount:
if (fsock != -1)
close(fsock);
return retval;
-}
+}
/*
* We need to translate between nfs status return values and
diff --git a/mdk-stage1/ppp/pppd/tdb.c b/mdk-stage1/ppp/pppd/tdb.c
index 7fd58291e..045460656 100644
--- a/mdk-stage1/ppp/pppd/tdb.c
+++ b/mdk-stage1/ppp/pppd/tdb.c
@@ -272,7 +272,7 @@ static char *tdb_alloc_read(TDB_CONTEXT *tdb, tdb_off offset, tdb_len len)
free(buf);
return NULL;
}
-
+
return buf;
}
@@ -431,7 +431,7 @@ static tdb_off tdb_allocate(TDB_CONTEXT *tdb, tdb_len length)
rec.rec_len = length;
rec.next = rec_ptr + sizeof(rec) + rec.rec_len;
-
+
if (rec_write(tdb, rec.next, &newrec) == -1) {
goto fail;
}
@@ -447,7 +447,7 @@ static tdb_off tdb_allocate(TDB_CONTEXT *tdb, tdb_len length)
if (ofs_write(tdb, offset, &rec.next) == -1) {
goto fail;
- }
+ }
} else {
lastrec.next = rec.next;
if (rec_write(tdb, last_ptr, &lastrec) == -1) {
@@ -482,7 +482,6 @@ static tdb_off tdb_allocate(TDB_CONTEXT *tdb, tdb_len length)
static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size)
{
struct tdb_header header;
- tdb_off offset;
int i, size = 0;
tdb_off buf[16];
@@ -493,15 +492,14 @@ static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size)
header.hash_size = hash_size;
lseek(tdb->fd, 0, SEEK_SET);
ftruncate(tdb->fd, 0);
-
+
if (tdb->fd != -1 && write(tdb->fd, &header, sizeof(header)) !=
sizeof(header)) {
tdb->ecode = TDB_ERR_IO;
return -1;
} else size += sizeof(header);
-
+
/* the freelist and hash pointers */
- offset = 0;
memset(buf, 0, sizeof(buf));
for (i=0;(hash_size+1)-i >= 16; i += 16) {
@@ -543,7 +541,7 @@ static tdb_off tdb_find(TDB_CONTEXT *tdb, TDB_DATA key, unsigned int hash,
struct list_struct *rec)
{
tdb_off offset, rec_ptr;
-
+
/* find the top of the hash chain */
offset = tdb_hash_top(tdb, hash);
@@ -680,7 +678,7 @@ TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key)
rec.data_len);
ret.dsize = rec.data_len;
}
-
+
tdb_unlock(tdb, BUCKET(hash));
return ret;
}
@@ -696,7 +694,7 @@ int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key)
unsigned hash;
tdb_off rec_ptr;
struct list_struct rec;
-
+
if (tdb == NULL) {
#ifdef TDB_DEBUG
printf("tdb_exists() called with null context\n");
@@ -859,7 +857,7 @@ TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA key)
/* find which hash bucket it is in */
hash = tdb_hash(&key);
hbucket = BUCKET(hash);
-
+
tdb_lock(tdb, hbucket);
rec_ptr = tdb_find(tdb, key, hash, &rec);
if (rec_ptr) {
@@ -951,7 +949,7 @@ int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key)
lastrec.next = rec.next;
if (rec_write(tdb, last_ptr, &lastrec) == -1) {
goto fail;
- }
+ }
}
tdb_unlock(tdb, BUCKET(hash));
tdb_lock(tdb, -1);
@@ -1132,7 +1130,7 @@ TDB_CONTEXT *tdb_open(char *name, int hash_size, int tdb_flags,
/* ensure there is only one process initialising at once */
tdb_brlock(&tdb, GLOBAL_LOCK, LOCK_SET, F_WRLCK, F_SETLKW);
-
+
if (tdb_flags & TDB_CLEAR_IF_FIRST) {
/* we need to zero the database if we are the only
one with it open */
diff --git a/mdk-stage1/ppp/pppd/utils.c b/mdk-stage1/ppp/pppd/utils.c
index 64b960a63..0294ccf42 100644
--- a/mdk-stage1/ppp/pppd/utils.c
+++ b/mdk-stage1/ppp/pppd/utils.c
@@ -616,10 +616,9 @@ logit(level, fmt, args)
char *fmt;
va_list args;
{
- int n;
char buf[1024];
- n = vslprintf(buf, sizeof(buf), fmt, args);
+ vslprintf(buf, sizeof(buf), fmt, args);
log_write(level, buf);
}
@@ -946,4 +945,3 @@ unlock()
lock_file[0] = 0;
}
}
-
diff --git a/mdk-stage1/stdio-frontend.c b/mdk-stage1/stdio-frontend.c
index f99575bed..ec85550ac 100644
--- a/mdk-stage1/stdio-frontend.c
+++ b/mdk-stage1/stdio-frontend.c
@@ -53,7 +53,7 @@ static void get_any_response(void)
while (read(0, &t, 1) > 0);
fcntl(0, F_SETFL, 0);
}
-
+
static int get_int_response(void)
{
char s[50];
@@ -76,7 +76,6 @@ static char * get_string_response(char * initial_string)
/* I won't use a scanf/%s since I also want the null string to be accepted -- also, I want the initial_string */
char s[500];
int i = 0;
- char buf[10];
int b_index = 0;
char b;
@@ -89,7 +88,7 @@ static char * get_string_response(char * initial_string)
strcpy(s, initial_string);
i = strlen(s);
}
-
+
/* from ncurses/tinfo/lib_raw.c:(cbreak) */
tcgetattr(0, &t);
t.c_lflag &= ~ICANON;
@@ -108,7 +107,6 @@ static char * get_string_response(char * initial_string)
if (read(0, &b, 1) > 0) {
if (b_index == 1) {
if (b == 91) {
- buf[b_index] = b;
b_index++;
continue;
}
@@ -131,7 +129,7 @@ static char * get_string_response(char * initial_string)
b_index = 0;
continue;
}
-
+
if (b == 13)
break;
if (b == 127) {
@@ -146,7 +144,6 @@ static char * get_string_response(char * initial_string)
i--;
}
} else if (b == 27) {
- buf[b_index] = b;
b_index++;
} else {
printf("%c", b);
@@ -226,7 +223,7 @@ void update_progression_raw(int current_size)
}
} else
printf("\033[GStatus: [%8d] bytes loaded...", current_size);
-
+
fflush(stdout);
}
@@ -275,7 +272,7 @@ enum return_type ask_from_list_index(char *msg, char ** elems, char ** elems_com
}
if (j == 4)
j = 0;
-
+
if (elems_comments)
elems_comments++;
i++;