From 736648a7ef1d4ef09a0837c2bfebf8a2a20bd7e2 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 16 May 2012 11:02:42 +0800 Subject: [PATCH] Usermode - Little debug and other fixes --- Usermode/Applications/dhcpclient_src/main.c | 8 ++++++-- Usermode/Applications/login_src/main.c | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Usermode/Applications/dhcpclient_src/main.c b/Usermode/Applications/dhcpclient_src/main.c index 149bd0a1..7c0b0726 100644 --- a/Usermode/Applications/dhcpclient_src/main.c +++ b/Usermode/Applications/dhcpclient_src/main.c @@ -148,6 +148,10 @@ void Scan_Dir(tInterface **IfaceList, const char *Directory) int dp = open(Directory, OPENFLAG_READ); char filename[FILENAME_MAX]; + if( dp == -1 ) { + fprintf(stderr, "Unable to open directory '%s'\n", Directory); + } + while( readdir(dp, filename) ) { if( filename[0] == '.' ) continue ; @@ -204,11 +208,11 @@ int Start_Interface(tInterface *Iface) } tmp = 68; ioctl(fd, 4, &tmp); // Local port tmp = 67; ioctl(fd, 5, &tmp); // Remote port - tmp = 0; ioctl(fd, 7, &tmp); // Remote addr mask - we don't care where the reply comes from + tmp = 0; ioctl(fd, 7, &tmp); // Remote addr mask bits - we don't care where the reply comes from addr[0] = addr[1] = addr[2] = addr[3] = 255; // 255.255.255.255 ioctl(fd, 8, addr); // Remote address - return fd; + return 0; } void Send_DHCPDISCOVER(tInterface *Iface) diff --git a/Usermode/Applications/login_src/main.c b/Usermode/Applications/login_src/main.c index ab82a14a..e859bfeb 100644 --- a/Usermode/Applications/login_src/main.c +++ b/Usermode/Applications/login_src/main.c @@ -47,8 +47,6 @@ int main(int argc, char *argv[]) return -1; } - printf("pid = %i\n", pid); - // Spawn shell in a child process if(pid == 0) { -- 2.20.1