Skip to contentSkip to conversation

warning when building sighold02.c

LTP David Marlin 2 participants 2 messages Aug 16, 2010

lore
Share & tools
lore
#0 lore raw

The functions read_pipe and write_pipe in sighold02.c each expect a single file descriptor as arguments, however the function prototypes define no arguments. Also, the function references to read_pipe pass two arguments, a file descriptor and '0'. The second argument should not be passed, as it is not used.

Attached is a patch to make the function argument definitions and uses consistent within this testcase.

kernel/syscalls/sighold/sighold02.c renamed from kernel/syscalls/sighold/sighold02.c.orig +5 -5
@@ -145,8 +145,8 @@
 void cleanup();
 static void getout();
 static void timeout();
-static int read_pipe();
-static int write_pipe();
+static int read_pipe(int fd);
+static int write_pipe(int fd);
 static int setup_sigs(char *mesg);
 static void handle_sigs();
 static int set_timeout(char *mesg);
@@ -202,7 +202,7 @@
 			tst_sig(FORK, DEF_HANDLER, getout);
 
 			/* wait for "ready" message from child */
-			if (read_pipe(PARENTSREADFD, 0) != 0) {
+			if (read_pipe(PARENTSREADFD) != 0) {
 				/* read_pipe() failed. */
 				tst_brkm(TBROK, getout, "%s", p_p.mesg);
 			}
@@ -272,7 +272,7 @@
 			 * Get childs reply about received signals.
 			 */
 
-			if (read_pipe(PARENTSREADFD, 0) < 0) {
+			if (read_pipe(PARENTSREADFD) < 0) {
 				tst_brkm(TBROK, getout, "%s", p_p.mesg);
 			}
 
@@ -384,7 +384,7 @@
 	/*
 	 * Read pipe from parent, that will tell us that all signals were sent
 	 */
-	if (read_pipe(CHILDSREADFD, 0) != 0) {
+	if (read_pipe(CHILDSREADFD) != 0) {
 		p_p.result = TBROK;
 		strcpy(p_p.mesg, "read() pipe failed");
 	} else if (signals_received[0] == '\0') {

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 9 lines · David Marlin

The functions read_pipe and write_pipe in sighold02.c each expect a single file descriptor as arguments, however the function prototypes define no arguments.  Also, the function references to read_pipe pass two arguments, a file descriptor and '0'.  The second argument should not be passed, as it is not used.

Attached is a patch to make the function argument definitions and uses consistent within this testcase.

ACK.

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list