From: Jesper Juhl <juhl@eisenstein.dk>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] minor correctness fix to the Documentation/rtc.txt example program.
Date: Sun, 22 Apr 2001 03:23:22 +0200 [thread overview]
Message-ID: <3AE2328A.10703@eisenstein.dk> (raw)
[-- Attachment #1: Type: text/plain, Size: 1528 bytes --]
-------- 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 <juhl@eisenstein.dk>
To: p_gortmaker@yahoo.com
CC: linux-net@vger.kernel.org
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 ]-----
--- linux-2.4.3-vanilla/Documentation/rtc.txt Sun Apr 22 02:33:10 2001
+++ linux-2.4.3/Documentation/rtc.txt Sun Apr 22 02:39:55 2001
@@ -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 - juhl@eisenstein.dk
[-- Attachment #2: rtc.txt-patch --]
[-- Type: text/plain, Size: 380 bytes --]
--- linux-2.4.3-vanilla/Documentation/rtc.txt Sun Apr 22 02:33:10 2001
+++ linux-2.4.3/Documentation/rtc.txt Sun Apr 22 02:39:55 2001
@@ -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 */
next reply other threads:[~2001-04-21 23:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-22 1:23 Jesper Juhl [this message]
2001-04-22 0:35 ` dhcpd help please joker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3AE2328A.10703@eisenstein.dk \
--to=juhl@eisenstein.dk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox