Browse Source

Fixes for #23 and #24, violations of the C standard

Marc Di Luzio 7 years ago
parent
commit
9bb3ebf34b
2 changed files with 5 additions and 4 deletions
  1. 2 1
      daemon/main.c
  2. 3 3
      lib/gamemode_client.h

+ 2 - 1
daemon/main.c

@@ -58,6 +58,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #include <signal.h>
 #include <string.h>
 #include <unistd.h>
+#include <stdlib.h>
 
 #define USAGE_TEXT                                                                                 \
 	"Usage: %s [-d] [-l] [-h] [-v]\n\n"                                                            \
@@ -77,7 +78,7 @@ static void sigint_handler(__attribute__((unused)) int signo)
 	/* Clean up nicely */
 	game_mode_context_destroy(game_mode_context_instance());
 
-	exit(EXIT_SUCCESS);
+	_Exit(EXIT_SUCCESS);
 }
 
 /**

+ 3 - 3
lib/gamemode_client.h

@@ -28,8 +28,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 
  */
-#ifndef _CLIENT_GAMEMODE_H_
-#define _CLIENT_GAMEMODE_H_
+#ifndef CLIENT_GAMEMODE_H
+#define CLIENT_GAMEMODE_H
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -212,4 +212,4 @@ int gamemode_request_end(void)
 	return 0;
 }
 
-#endif // _CLIENT_GAMEMODE_H_
+#endif // CLIENT_GAMEMODE_H