On 9/5/22 3:42 PM, Alviro Iskandar Setiawan wrote:
On Mon, Sep 5, 2022 at 2:12 PM Ammar Faizi wrote:fd = open(fname, O_WRONLY); if (fd < 0) { perror("open"); - goto err; + ret = 1; + goto out; } for (i = 0; i < NR_BUFS; i++) { memset(buf, i + 1, BUF_SIZE); ret = write(fd, buf, BUF_SIZE); if (ret != BUF_SIZE) { fprintf(stderr, "bad file prep write\n"); - goto err; + ret = 1; + close(fd); + goto out; } }should use T_EXIT_* for ret?
Yes, we should. I forgot, will send a v2. -- Ammar Faizi