[geany/geany] 044120: Windows: properly initialize errno before checking it

Colomban Wendling git-noreply at xxxxx
Wed Feb 19 14:56:24 UTC 2014


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Wed, 19 Feb 2014 14:56:24 UTC
Commit:      044120e87ce8ce021832868ae690d282f59d3b15
             https://github.com/geany/geany/commit/044120e87ce8ce021832868ae690d282f59d3b15

Log Message:
-----------
Windows: properly initialize errno before checking it

errno is never reset to 0 by the system libraries, so if we test
its value we need to reset it to 0 before the call that may change
it to something else.


Modified Paths:
--------------
    src/win32.c

Modified: src/win32.c
1 files changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -1058,6 +1058,7 @@ gboolean win32_spawn(const gchar *dir, gchar **argv, gchar **env, GSpawnFlags fl
 		locale_command = g_strdup(command);
 	geany_debug("WIN32: actually running command:\n%s", command);
 	g_chdir(dir);
+	errno = 0;
 	ret = system(locale_command);
 	/* the command can return -1 as an exit code, so check errno also */
 	fail = ret == -1 && errno;



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list