aboutsummaryrefslogtreecommitdiffstats
path: root/src/log-login-btmp.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/log-login-btmp.c34
1 files changed, 4 insertions, 30 deletions
diff --git a/src/log-login-btmp.c b/src/log-login-btmp.c
index 35b2b31..6d4ae18 100644
--- a/src/log-login-btmp.c
+++ b/src/log-login-btmp.c
@@ -17,42 +17,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common.h"
-
#include <utmp.h>
-
-#define X(A) static const char* A = NULL;
- LIST_ARGUMENTS
-#undef X
-
-
-static int log_action(void);
-
-
-int main(int argc, char** argv)
+int do_log(void)
{
- int i;
-
- for (i = 1; i < argc; i++)
- {
-#define X(A) if (strstr(argv[i], "--" #A "=")) A = strchr(argv[i], '=') + 1;
- LIST_ARGUMENTS
-#undef X
- }
+ struct utmp ut;
- if (!streq(action, "failed")) return 0;
- if (NULL == username) return 1;
- if (NULL == ttyname) return 1;
- if (NULL == pid) return 1;
+ if (!streq(action, "failed"))
+ return 0;
- return -log_action();
-}
-
-
-static int log_action(void)
-{
- struct utmp ut;
memset(&ut, 0, sizeof(struct utmp));
ut.ut_type = LOGIN_PROCESS;