Skip to contentSkip to conversation

minor correctness fix to the Documentation/rtc.txt example program.

PATCH In review Jesper Juhl 2 participants 2 messages Apr 21, 2001 – Apr 22, 2001 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minor correctness fix to the Documentation/rtc.txt example program.

-------- Original Message --------
Subject: [PATCH] minor correctness fix to the Documentation/rtc.txt example program.
Date: Sun, 22 Apr 2001 03:06:04 +0200
From: Jesper Juhl <[email protected]>
To: [email protected]
CC: [email protected]

Hi,

When compiling the example program from Documentation/rtc.txt there is a tiny compiler warning about main() not returning int. That is no big deal, but for the sake of correctness (and since main actually does return a value on error) I have made a small patch to fix it (see below, patch also attached as 'rtc.txt-patch').

The patch is pretty self explaining. It changes the return type of main to int and adds a call to exit(0) at the end of main(), so now we have killed the warning and return a meaningfull value on sucessfull completion.

The patch is against vanilla 2.4.3 and applies cleanly and the program in rtc.txt compiles and runs without a problem after applying the patch.

I hope you like the patch and will apply it (comments and criticism is welcome) :-)

-----[ Start of patch ]-----

Documentation/rtc.txt Sun Apr 22 02:39:55 2001 renamed from Documentation/rtc.txt Sun Apr 22 02:33:10 2001 +1 -1
@@ -89,7 +89,7 @@
  #include <unistd.h>
  #include <errno.h>
 
-void main(void) {
+int main(void) {
 
  int i, fd, retval, irqcount = 0;
  unsigned long tmp, data;
@@ -277,5 +277,6 @@
 

irqcount);

close(fd);
+exit(0);

  } /* end main */

-----[ End of patch ]-----

Best regards,
Jesper Juhl - [email protected]

Documentation/rtc.txt +2 -1
@@ -89,7 +89,7 @@
 #include <unistd.h>
 #include <errno.h>
 
-void main(void) {
+int main(void) {
 
 int i, fd, retval, irqcount = 0;
 unsigned long tmp, data;
@@ -277,5 +277,6 @@
 								 irqcount);
 
 close(fd);
+exit(0);
 
 } /* end main */
#1 lore raw

dhcpd help please

I have problem starting dhcpd, this first time try out any 1 can help me this error message. any can point out my problem
10q in advance

[root@classical]# dhcpd eth0
Internet Software Consortium DHCP Server 2.0pl5
Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
All rights reserved.

Please contribute if you find this software useful. For info, please visit http://www.isc.org/dhcp-contrib.html

Listening on LPF/eth0/00:01:02:83:51:7e/192.168.8.0
Sending on LPF/eth0/00:01:02:83:51:7e/192.168.8.0
Can't bind to dhcp address: Address already in use exiting.
--------------------

[root@homepc]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.8.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
203.56.56.0    0.0.0.0         255.255.252.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         203.56.56.1    0.0.0.0         UG    0      0        0 eth1
[f00l@classical f00l]#

---------------------------
[f00l@classical /etc]# cat dhcpd.conf
# Sample /etc/dhcpd.conf
# (add your comments here) default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.8.255; option routers 192.168.8.254;
option domain-name-servers 203.56.1.21,203.56.1.22; option domain-name "homepc.linux.org"; option netbios-name-servers 192.168.8.1;

subnet 192.168.8.0 netmask 255.255.255.0 {
range 192.168.8.30 192.168.8.35;
}