@@ -474,21 +474,21 @@ func (j *Journal) FlushMatches() {
474474}
475475
476476// Next advances the read pointer into the journal by one entry.
477- func (j * Journal ) Next () (int , error ) {
477+ func (j * Journal ) Next () (uint64 , error ) {
478478 sd_journal_next , err := getFunction ("sd_journal_next" )
479479 if err != nil {
480- return - 1 , err
480+ return 0 , err
481481 }
482482
483483 j .mu .Lock ()
484484 r := C .my_sd_journal_next (sd_journal_next , j .cjournal )
485485 j .mu .Unlock ()
486486
487487 if r < 0 {
488- return int ( r ) , fmt .Errorf ("failed to iterate journal: %d" , syscall .Errno (- r ))
488+ return 0 , fmt .Errorf ("failed to iterate journal: %d" , syscall .Errno (- r ))
489489 }
490490
491- return int (r ), nil
491+ return uint64 (r ), nil
492492}
493493
494494// NextSkip advances the read pointer by multiple entries at once,
@@ -504,7 +504,7 @@ func (j *Journal) NextSkip(skip uint64) (uint64, error) {
504504 j .mu .Unlock ()
505505
506506 if r < 0 {
507- return uint64 ( r ) , fmt .Errorf ("failed to iterate journal: %d" , syscall .Errno (- r ))
507+ return 0 , fmt .Errorf ("failed to iterate journal: %d" , syscall .Errno (- r ))
508508 }
509509
510510 return uint64 (r ), nil
@@ -522,7 +522,7 @@ func (j *Journal) Previous() (uint64, error) {
522522 j .mu .Unlock ()
523523
524524 if r < 0 {
525- return uint64 ( r ) , fmt .Errorf ("failed to iterate journal: %d" , syscall .Errno (- r ))
525+ return 0 , fmt .Errorf ("failed to iterate journal: %d" , syscall .Errno (- r ))
526526 }
527527
528528 return uint64 (r ), nil
@@ -541,7 +541,7 @@ func (j *Journal) PreviousSkip(skip uint64) (uint64, error) {
541541 j .mu .Unlock ()
542542
543543 if r < 0 {
544- return uint64 ( r ) , fmt .Errorf ("failed to iterate journal: %d" , syscall .Errno (- r ))
544+ return 0 , fmt .Errorf ("failed to iterate journal: %d" , syscall .Errno (- r ))
545545 }
546546
547547 return uint64 (r ), nil
0 commit comments