mirror of
https://gogs.blitter.com/RLabs/goutmp
synced 2024-08-14 19:26:41 +00:00
Use utmp APIs rather than utmpx to be more portable
This commit is contained in:
parent
9047cf4dd3
commit
bdf19c1664
2 changed files with 17 additions and 18 deletions
15
main/test.go
15
main/test.go
|
@ -1,14 +1,15 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"blitter.com/go/goutmp"
|
||||
"blitter.com/go/goutmp"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
user := "bin"
|
||||
host := "test.example.com"
|
||||
utmp := goutmp.Put_utmp(user, host)
|
||||
goutmp.Put_lastlog_entry("hkexsh", user, host)
|
||||
goutmp.Unput_utmp(utmp)
|
||||
user := "bin"
|
||||
host := "test.example.com"
|
||||
utmp := goutmp.Put_utmp(user, host)
|
||||
goutmp.Put_lastlog_entry("hkexsh", user, host)
|
||||
time.Sleep(10 * time.Second)
|
||||
goutmp.Unput_utmp(utmp)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue