write-out should truncate

This commit is contained in:
K. Lange 2018-07-17 17:08:34 +09:00
parent ee3ca2ebd4
commit e7b2e5a006

View File

@ -3,7 +3,7 @@
#include <stdio.h>
int main(int argc, char * argv[]) {
int fd = open(argv[1], O_WRONLY | O_CREAT, 0666);
int fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0666);
while (1) {
char buf[1024];