mirror of
https://github.com/rclone/rclone.git
synced 2025-11-23 21:44:49 +02:00
fs: remove unnecessary Seek call on log file
We were seeing a (non-fatal) error in our logs: ``` Failed to seek log file to end: seek /proc/1/fd/1: illegal seek ``` Because we open the log file with O_APPEND, we don't need to manually seek to the end. As https://pkg.go.dev/os#File.Seek also confirms that the behavior of `Seek` is not specified if the file has been opened with O_APPEND, remove the `Seek` call.
This commit is contained in:
committed by
Nick Craig-Wood
parent
f28c83c6de
commit
70d2fe6568
@@ -216,10 +216,6 @@ func InitLogging() {
|
||||
if err != nil {
|
||||
fs.Fatalf(nil, "Failed to open log file: %v", err)
|
||||
}
|
||||
_, err = f.Seek(0, io.SeekEnd)
|
||||
if err != nil {
|
||||
fs.Errorf(nil, "Failed to seek log file to end: %v", err)
|
||||
}
|
||||
redirectStderr(f)
|
||||
w = f
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user