Merge pull request #340 from harshavardhana/pr_out_make_sure_we_use_o_excl_with_o_create_to_make_sure_we_don_t_trip_over_existing_file

master
Harshavardhana 10 years ago
commit 562a57be84
  1. 2
      pkg/storage/donut/donutwriter.go

@ -8,7 +8,7 @@ import (
) )
func newDonutFileWriter(objectDir string) (Writer, error) { func newDonutFileWriter(objectDir string) (Writer, error) {
dataFile, err := os.OpenFile(path.Join(objectDir, "data"), os.O_WRONLY|os.O_CREATE, 0600) dataFile, err := os.OpenFile(path.Join(objectDir, "data"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC|os.O_EXCL, 0600)
if err != nil { if err != nil {
return nil, err return nil, err
} }

Loading…
Cancel
Save