libbb: added xfdopen_for_read/write
[platform/upstream/busybox.git] / modutils / modprobe-small.c
index 8ef9101..53b7c94 100644 (file)
@@ -384,11 +384,7 @@ static void write_out_dep_bb(int fd)
        FILE *fp;
 
        /* We want good error reporting. fdprintf is not good enough. */
-       fp = fdopen(fd, "w");
-       if (!fp) {
-               close(fd);
-               goto err;
-       }
+       fp = xfdopen_for_write(fd);
        i = 0;
        while (modinfo[i].pathname) {
                fprintf(fp, "%s%s%s\n" "%s%s\n",