Skip to content

Commit 77ef9f5

Browse files
author
Lou
committed
use TRUNC instead of APPEND
Signed-off-by: Lou <[email protected]>
1 parent 6987264 commit 77ef9f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

iscsi/iscsi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ func RemovePhysicalDevice(devices ...string) error {
405405
debug.Printf("Delete scsi device %v.\n", deviceName)
406406
// Remove a scsi device by executing 'echo "1" > /sys/block/sdx/device/delete
407407
filename := filepath.Join(sysBlockPath, deviceName, "device", "delete")
408-
if f, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY, 0200); err != nil {
408+
if f, err := os.OpenFile(filename, os.O_TRUNC|os.O_WRONLY, 0200); err != nil {
409409
if os.IsNotExist(err) {
410410
continue
411411
} else {

0 commit comments

Comments
 (0)