summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-02-25 15:35:16 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2011-02-25 15:35:16 -0800
commitb0bbc07d9a136869d1d9acfdd8e14674515eb196 (patch)
tree0cced855adde9a06c88e52392d5fe8829a5d3814 /lib-src
parent3f5e6230d78d28cd4acba7a7eaa2292477f4e0ff (diff)
downloademacs-b0bbc07d9a136869d1d9acfdd8e14674515eb196.tar.gz
* emacsclient.c: Redo local variables to avoid shadowing problems.
(message, socket_status, start_daemon_and_retry_set_socket): Rename locals. (main): Move decl of "i".
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/emacsclient.c17
2 files changed, 14 insertions, 8 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index cbaa5559f96..5b8033d2aec 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,5 +1,10 @@
2011-02-25 Paul Eggert <eggert@cs.ucla.edu>
+ * emacsclient.c: Redo local variables to avoid shadowing problems.
+ (message, socket_status, start_daemon_and_retry_set_socket):
+ Rename locals.
+ (main): Move decl of "i".
+
* etags.c (ISUPPER): Move to inside the only #ifdef where it's used.
This avoids an unused-macro warning with some GCC settings.
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 8d5f0482637..070d6370714 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -474,13 +474,13 @@ ttyname (int fd)
/* Display a normal or error message.
On Windows, use a message box if compiled as a Windows app. */
static void
-message (int is_error, const char *message, ...)
+message (int is_error, const char *format, ...)
{
char msg[2048];
va_list args;
- va_start (args, message);
- vsprintf (msg, message, args);
+ va_start (args, format);
+ vsprintf (msg, format, args);
va_end (args);
#ifdef WINDOWSNT
@@ -1080,11 +1080,11 @@ find_tty (char **tty_type, char **tty_name, int noabort)
0 - success: none of the above */
static int
-socket_status (char *socket_name)
+socket_status (char *name)
{
struct stat statbfr;
- if (stat (socket_name, &statbfr) == -1)
+ if (stat (name, &statbfr) == -1)
return 2;
if (statbfr.st_uid != geteuid ())
@@ -1483,8 +1483,8 @@ start_daemon_and_retry_set_socket (void)
else
{
char emacs[] = "emacs";
- char daemon[] = "--daemon";
- char *d_argv[] = {emacs, daemon, 0 };
+ char daemon_option[] = "--daemon";
+ char *d_argv[] = {emacs, daemon_option, 0 };
if (socket_name != NULL)
{
/* Pass --daemon=socket_name as argument. */
@@ -1504,7 +1504,7 @@ start_daemon_and_retry_set_socket (void)
int
main (int argc, char **argv)
{
- int i, rl, needlf = 0;
+ int rl, needlf = 0;
char *cwd, *str;
char string[BUFSIZ+1];
int null_socket_name, null_server_file, start_daemon_if_needed;
@@ -1635,6 +1635,7 @@ main (int argc, char **argv)
if ((argc - optind > 0))
{
+ int i;
for (i = optind; i < argc; i++)
{