From: John Hodge Date: Wed, 16 May 2012 03:02:42 +0000 (+0800) Subject: Usermode - Little debug and other fixes X-Git-Tag: rel0.15~611^2~104 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=736648a7ef1d4ef09a0837c2bfebf8a2a20bd7e2;p=tpg%2Facess2.git Usermode - Little debug and other fixes --- 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) {