projects
/
irc-logger.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r8496: make last field for rpl_topicwhotime a utime
[irc-logger.git]
/
logger.lisp
diff --git
a/logger.lisp
b/logger.lisp
index 449f154a08e97c76b37f1e0c0e4c43b87347b252..c434cd3577a810f56db5b968616fe7f27963cf58 100644
(file)
--- a/
logger.lisp
+++ b/
logger.lisp
@@
-251,6
+251,12
@@
((time (* time-t)))
:returning :cstring)
((time (* time-t)))
:returning :cstring)
+(defconstant +posix-epoch+
+ (encode-universal-time 0 0 0 1 1 1970 0))
+
+(defun posix-time-to-utime (time)
+ (+ time +posix-epoch+))
+
(defun last-sexp-field (type msg)
(cond
((null msg)
(defun last-sexp-field (type msg)
(cond
((null msg)
@@
-261,11
+267,7
@@
(when (stringp (car (last (arguments msg))))
(let ((secs (parse-integer (car (last (arguments msg))) :junk-allowed t)))
(when secs
(when (stringp (car (last (arguments msg))))
(let ((secs (parse-integer (car (last (arguments msg))) :junk-allowed t)))
(when secs
- (string-right-trim '(#\newline #\return)
- (uffi:convert-from-cstring
- (uffi:with-foreign-object (time 'time-t)
- (setf (uffi:deref-pointer time :unsigned-long) secs)
- (c-ctime time))))))))
+ (posix-time-to-utime secs)))))
((need-user-address? type)
(user-address msg))))
((need-user-address? type)
(user-address msg))))