Diego Nieto Cid, le mar. 03 déc. 2024 17:11:58 -0300, a ecrit: > El mar, 3 dic 2024 a las 12:47, Samuel Thibault > (<samuel.thiba...@gnu.org>) escribió: > > > > Yes, the current behavior is really odd, I don't see why zstd would try > > to remove /dev/zero... > > > > I managed to craft a small reproducer by doing the following steps: > > 1. open /dev/zero > 2. write something into it > 3. close it > > Here is the code: > > ---->8-------->8---- > #include <errno.h> > #include <stdio.h> > #include <string.h> > > int main(int argc, char ** argv) > { > FILE *file = fopen(argv[1], "wb"); > fprintf(file, "Hello World!\n"); > int ret = fclose(file); > printf("fclose ret: %d; err = %s\n", ret, strerror(errno)); > return 0; > } > ---->8-------->8---- > > Running it on /dev/zero gives the following result: > > $ ./fclose /dev/zero > fclose ret: -1; err = Success > > So while errno shows no apparent error, fclose still returns -1.
Oh, that's odd indeed. Perhaps run it through rpctrace to see what happens behind. Samuel