git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] imap-send: cleanup execl() call to use NULL sentinel instead of 0

From
MRMarco Roeland <marco.roeland@xs4all.nl>
Date
Mar 11, 2006, 08:55 UTC
Message-ID
<20060311085550.GA32089@fiberbit.xs4all.nl>

Some versions of gcc check that calls to the exec() family have the proper sentinel for variadic calls. This should be (char *) NULL according to the man page. Although for all other purposes the 0 is equivalent, gcc nevertheless does emit a warning for 0 and not for NULL. This also makes the usage consistent throughout git.

The whitespace in function calls throughout imap-send.c has its own style, so I left it that way.

---
 imap-send.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
db1a0875cbc28970208e7a2fbb93d680d8ffe572
diff --git a/imap-send.c b/imap-send.c
index fddaac0..203284d 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -945,7 +945,7 @@ imap_open_store( imap_server_conf_t *srv
 				_exit( 127 );
 			close( a[0] );
 			close( a[1] );
-			execl( "/bin/sh", "sh", "-c", srvc->tunnel, 0 );
+			execl( "/bin/sh", "sh", "-c", srvc->tunnel, NULL );
 			_exit( 127 );
 		}
 
-- 
1.2.4.ge29f
Marco Roeland
Next: Morten Welinder
Message 1 of 3 in “imap-send: cleanup execl() call to use NULL sentinel instead of 0”
  1. imap-send: cleanup execl() call to use NULL sentinel instead of 0Marco Roeland, Mar 11, 2006
  2. Morten WelinderMar 11, 2006
  3. Marco RoelandMar 11, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.