More g_* functions usage

Follow coding standard
This commit is contained in:
BLINDAUER Emmanuel 2017-11-12 17:18:15 +01:00 committed by matt335672
parent 58b3989655
commit 22f17ad123
2 changed files with 11 additions and 12 deletions

View File

@ -38,6 +38,7 @@
#include "log.h"
#include "os_calls.h"
#include "string_calls.h"
#include "sessionrecord.h"
/*
@ -51,16 +52,16 @@ add_xtmp_entry(int pid, const char *line, const char *user, const char *rhostnam
_utmp ut;
struct timeval tv;
memset(&ut, 0, sizeof(ut));
g_memset(&ut, 0, sizeof(ut));
ut.ut_type=state;
ut.ut_pid = pid;
gettimeofday(&tv, NULL);
ut.ut_tv.tv_sec = tv.tv_sec;
ut.ut_tv.tv_usec = tv.tv_usec;
strncpy(ut.ut_line, line , sizeof(ut.ut_line));
strncpy(ut.ut_user, user , sizeof(ut.ut_user));
strncpy(ut.ut_host, rhostname, sizeof(ut.ut_host));
g_strncpy(ut.ut_line, line , sizeof(ut.ut_line));
g_strncpy(ut.ut_user, user , sizeof(ut.ut_user));
g_strncpy(ut.ut_host, rhostname, sizeof(ut.ut_host));
/* utmp */
setutxent();

View File

@ -36,16 +36,14 @@ typedef struct utmp _utmp;
#define XRDP_LINE_FORMAT "xrdp:%d"
/**
*
* @brief
*
* @param pid
* @return 0
*/
int add_xtmp_entry(int pid, const char *line, const char *user, const char *rhostname, short state);
/**
* @brief functions for adding utmp entries. one at login, one for logout
*
* @param pid of the session, display, login, and hostname
* @return 0
*/
int utmp_login(int pid, int display, const char *user, const char *rhostname);
int utmp_logout(int pid, int display, const char *user, const char *rhostname);