aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-18 11:55:53 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-18 11:55:53 +0100
commit6b2def45ea0e5e1f999a06a6b2bd175662024abc (patch)
treeb17188d4bf621f35ec0fe4fc420ff9fcfca470a3 /src
parentupdate to new version of libpassphrase (diff)
downloadcerberus-6b2def45ea0e5e1f999a06a6b2bd175662024abc.tar.gz
cerberus-6b2def45ea0e5e1f999a06a6b2bd175662024abc.tar.bz2
cerberus-6b2def45ea0e5e1f999a06a6b2bd175662024abc.tar.xz
dco + do not require gcc
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src')
-rw-r--r--src/auth/pam.c9
-rw-r--r--src/cerberus.c10
-rw-r--r--src/cerberus.h5
-rw-r--r--src/login.h5
-rw-r--r--src/quit.h10
5 files changed, 33 insertions, 6 deletions
diff --git a/src/auth/pam.c b/src/auth/pam.c
index ed220a9..b418d18 100644
--- a/src/auth/pam.c
+++ b/src/auth/pam.c
@@ -32,7 +32,10 @@
#define __failed(RC) ((RC) != PAM_SUCCESS)
-static void quit_pam(int sig) __attribute__((noreturn));
+#ifdef __GNUC__
+__attribute__((noreturn))
+#endif
+static void quit_pam(int sig);
static int conv_pam(int num_msg, const struct pam_message** msg, struct pam_response** resp, void* appdata_ptr);
@@ -73,8 +76,10 @@ static char auto_authenticated = 1;
static char* (*passphrase_reader)(void) = NULL;
+#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
+#endif
/**
* Exit if a PAM instruction failed
*
@@ -92,7 +97,9 @@ static void do_pam(int rc)
_exit(1);
}
}
+#ifdef __GNUC__
# pragma GCC diagnostic pop
+#endif
/**
diff --git a/src/cerberus.c b/src/cerberus.c
index a5304a7..c22690e 100644
--- a/src/cerberus.c
+++ b/src/cerberus.c
@@ -460,6 +460,9 @@ void do_login(int argc, char** argv)
#if AUTH > 0
+/**
+ * Called before the process exits, to do cleanup
+ */
void preexit(void)
{
if (skip_auth == 0)
@@ -492,7 +495,9 @@ char* read_passphrase(void)
#endif
+#ifdef __GNUC__
# pragma GCC optimize "-O0"
+#endif
/**
@@ -512,7 +517,10 @@ void destroy_passphrase(void)
/**
* Wipe the passphrase when the program exits
*/
-static __attribute__((destructor)) void passphrase_destructor(void)
+#ifdef __GNUC__
+__attribute__((destructor))
+#endif
+static void passphrase_destructor(void)
{
destroy_passphrase();
}
diff --git a/src/cerberus.h b/src/cerberus.h
index d73ffc1..5db38b1 100644
--- a/src/cerberus.h
+++ b/src/cerberus.h
@@ -63,7 +63,10 @@ char* read_passphrase(void);
#define read_passphrase() NULL
#endif
-void destroy_passphrase(void) __attribute__((optimize("-O0")));
+#ifdef __GNUC__
+__attribute__((optimize("-O0")))
+#endif
+void destroy_passphrase(void);
#endif
diff --git a/src/login.h b/src/login.h
index 53a39cb..bfa088a 100644
--- a/src/login.h
+++ b/src/login.h
@@ -56,7 +56,10 @@ void set_environ(struct passwd* entry, char preserve_env);
*
* @param entry The user entry in the password file
*/
-void exec_shell(struct passwd* entry) __attribute__((noreturn));
+#ifdef __GNUC__
+__attribute__((noreturn))
+#endif
+void exec_shell(struct passwd* entry);
#endif
diff --git a/src/quit.h b/src/quit.h
index 957d463..630251d 100644
--- a/src/quit.h
+++ b/src/quit.h
@@ -25,14 +25,20 @@
*
* @param signal The signal the program received
*/
-void timeout_quit(int signal) __attribute__((noreturn));
+#ifdef __GNUC__
+__attribute__((noreturn))
+#endif
+void timeout_quit(int signal);
/**
* Quit function for user aborts
*
* @param signal The signal the program received
*/
-void user_quit(int signal) __attribute__((noreturn));
+#ifdef __GNUC__
+__attribute__((noreturn))
+#endif
+void user_quit(int signal);
#endif