Took out system() debugging again

This commit is contained in:
Russ Magee 2018-06-08 22:55:50 -07:00
parent 3c44cdbe3b
commit 59979a4896

View file

@ -19,7 +19,7 @@ package go_login
// //
// //
//void pututmp(struct utmpx* entry, char* name, char* host) { //void pututmp(struct utmpx* entry, char* name, char* host) {
// int32_t stat = system("echo ---- pre ----;who"); // //int32_t stat = system("echo ---- pre ----;who");
// //
// entry->ut_type = USER_PROCESS; // entry->ut_type = USER_PROCESS;
// entry->ut_pid = getpid(); // entry->ut_pid = getpid();
@ -34,7 +34,7 @@ package go_login
// setutxent(); // setutxent();
// pututxline(entry); // pututxline(entry);
// //
// stat = system("echo ---- post ----;who"); // //stat = system("echo ---- post ----;who");
//} //}
// //
//void unpututmp(struct utmpx* entry) { //void unpututmp(struct utmpx* entry) {
@ -45,7 +45,7 @@ package go_login
// setutxent(); // setutxent();
// pututxline(entry); // pututxline(entry);
// //
// int32_t stat = system("echo ---- cleanup ----;who; lastlog"); // //int32_t stat = system("echo ---- cleanup ----;who; lastlog");
// //
// endutxent(); // endutxent();
//} //}
@ -69,7 +69,7 @@ package go_login
// int fd = fileno(f); // int fd = fileno(f);
// if( write(fd, &l, sizeof(l)) == sizeof(l) ) { // if( write(fd, &l, sizeof(l)) == sizeof(l) ) {
// retval = 1; // retval = 1;
// int32_t stat = system("echo ---- lastlog ----; lastlog"); // //int32_t stat = system("echo ---- lastlog ----; lastlog");
// } // }
// } // }
// fclose(f); // fclose(f);
@ -108,6 +108,7 @@ func Put_lastlog_entry(app string, usr string, host string) {
fmt.Sscanf(u.Uid, "%d", &uid) fmt.Sscanf(u.Uid, "%d", &uid)
t := time.Now().Unix() t := time.Now().Unix()
stat := C.putlastlogentry(C.int64_t(t), C.int(uid), C.CString(app), C.CString(host)) _ = C.putlastlogentry(C.int64_t(t), C.int(uid), C.CString(app), C.CString(host))
fmt.Println("stat was:",stat) //stat := C.putlastlogentry(C.int64_t(t), C.int(uid), C.CString(app), C.CString(host))
//fmt.Println("stat was:",stat)
} }