Remove unused function
authorJohn Darrington <john@darrington.wattle.id.au>
Fri, 23 Oct 2015 18:57:44 +0000 (20:57 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Fri, 23 Oct 2015 19:02:34 +0000 (21:02 +0200)
src/data/file-name.c
src/data/file-name.h

index fa0eb794010f75b9b2666334c08b827422ed04bd..3e9fa6914a72d3a5dcc8e011bbcde94d274a782e 100644 (file)
@@ -250,29 +250,6 @@ fn_close (const char *fn, FILE *f)
     return fclose (f);
 }
 
-/* Creates a new file named FN with the given PERMISSIONS bits,
-   and returns a stream for it or a null pointer on failure.
-   MODE should be "w" or "wb". */
-FILE *
-create_stream (const char *fn, const char *mode, mode_t permissions)
-{
-  int fd;
-  FILE *stream;
-
-  fd = open (fn, O_WRONLY | O_CREAT | O_TRUNC, permissions);
-  if (fd < 0)
-    return NULL;
-
-  stream = fdopen (fd, mode);
-  if (stream == NULL)
-    {
-      int save_errno = errno;
-      close (fd);
-      errno = save_errno;
-    }
-
-  return stream;
-}
 
 /* A file's identity:
 
index 8e04d36a926dffb80618b236f60cf7e4309d802b..d37b2547e1511d8851534deca17bb69aad2a89db 100644 (file)
@@ -37,8 +37,6 @@ const char *fn_getenv_default (const char *variable, const char *def);
 FILE *fn_open (const char *fn, const char *mode);
 int fn_close (const char *fn, FILE *file);
 
-FILE *create_stream (const char *fn, const char *mode, mode_t permissions);
-
 struct file_identity *fn_get_identity (const char *file_name);
 void fn_free_identity (struct file_identity *);
 int fn_compare_file_identities (const struct file_identity *,