Просмотр исходного кода

cov (many): make sure all _set() functions return a signed int

in the body it can return -1, and callers check for -1.
but the return type is unsigned int?



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2849 fd59a12c-fef9-0310-b244-a6a79926bd2f
Angus Salkeld 15 лет назад
Родитель
Сommit
ad71b66c7b
2 измененных файлов с 12 добавлено и 12 удалено
  1. 6 6
      exec/logsys.c
  2. 6 6
      include/corosync/engine/logsys.h

+ 6 - 6
exec/logsys.c

@@ -1023,7 +1023,7 @@ int _logsys_system_setup(
 	return (0);
 	return (0);
 }
 }
 
 
-unsigned int _logsys_subsys_create (const char *subsys)
+int _logsys_subsys_create (const char *subsys)
 {
 {
 	int i;
 	int i;
 
 
@@ -1351,7 +1351,7 @@ void logsys_fork_completed (void)
 	_logsys_wthread_create ();
 	_logsys_wthread_create ();
 }
 }
 
 
-unsigned int logsys_config_mode_set (const char *subsys, unsigned int mode)
+int logsys_config_mode_set (const char *subsys, unsigned int mode)
 {
 {
 	int i;
 	int i;
 
 
@@ -1440,7 +1440,7 @@ char *logsys_format_get (void)
 	return format_buffer;
 	return format_buffer;
 }
 }
 
 
-unsigned int logsys_config_syslog_facility_set (
+int logsys_config_syslog_facility_set (
 	const char *subsys,
 	const char *subsys,
 	unsigned int facility)
 	unsigned int facility)
 {
 {
@@ -1468,7 +1468,7 @@ unsigned int logsys_config_syslog_facility_set (
 	return i;
 	return i;
 }
 }
 
 
-unsigned int logsys_config_syslog_priority_set (
+int logsys_config_syslog_priority_set (
 	const char *subsys,
 	const char *subsys,
 	unsigned int priority)
 	unsigned int priority)
 {
 {
@@ -1492,7 +1492,7 @@ unsigned int logsys_config_syslog_priority_set (
 	return i;
 	return i;
 }
 }
 
 
-unsigned int logsys_config_logfile_priority_set (
+int logsys_config_logfile_priority_set (
 	const char *subsys,
 	const char *subsys,
 	unsigned int priority)
 	unsigned int priority)
 {
 {
@@ -1516,7 +1516,7 @@ unsigned int logsys_config_logfile_priority_set (
 	return i;
 	return i;
 }
 }
 
 
-unsigned int logsys_config_debug_set (
+int logsys_config_debug_set (
 	const char *subsys,
 	const char *subsys,
 	unsigned int debug)
 	unsigned int debug)
 {
 {

+ 6 - 6
include/corosync/engine/logsys.h

@@ -167,7 +167,7 @@ extern int _logsys_system_setup(
 extern int _logsys_config_subsys_get (
 extern int _logsys_config_subsys_get (
 	const char *subsys);
 	const char *subsys);
 
 
-extern unsigned int _logsys_subsys_create (const char *subsys);
+extern int _logsys_subsys_create (const char *subsys);
 
 
 extern int _logsys_rec_init (unsigned int size);
 extern int _logsys_rec_init (unsigned int size);
 
 
@@ -237,15 +237,15 @@ extern char *logsys_format_get (void);
  *
  *
  * Pass a NULL subsystem to change them all
  * Pass a NULL subsystem to change them all
  */
  */
-extern unsigned int logsys_config_syslog_facility_set (
+extern int logsys_config_syslog_facility_set (
 	const char *subsys,
 	const char *subsys,
 	unsigned int facility);
 	unsigned int facility);
 
 
-extern unsigned int logsys_config_syslog_priority_set (
+extern int logsys_config_syslog_priority_set (
 	const char *subsys,
 	const char *subsys,
 	unsigned int priority);
 	unsigned int priority);
 
 
-extern unsigned int logsys_config_mode_set (
+extern int logsys_config_mode_set (
 	const char *subsys,
 	const char *subsys,
 	unsigned int mode);
 	unsigned int mode);
 
 
@@ -262,7 +262,7 @@ extern int logsys_config_file_set (
 	const char **error_string,
 	const char **error_string,
 	const char *file);
 	const char *file);
 
 
-extern unsigned int logsys_config_logfile_priority_set (
+extern int logsys_config_logfile_priority_set (
 	const char *subsys,
 	const char *subsys,
 	unsigned int priority);
 	unsigned int priority);
 
 
@@ -271,7 +271,7 @@ extern unsigned int logsys_config_logfile_priority_set (
  * everything is sent everywhere. priority values
  * everything is sent everywhere. priority values
  * for file and syslog are not overwritten.
  * for file and syslog are not overwritten.
  */
  */
-extern unsigned int logsys_config_debug_set (
+extern int logsys_config_debug_set (
 	const char *subsys,
 	const char *subsys,
 	unsigned int value);
 	unsigned int value);