]> git.tuebingen.mpg.de Git - osl.git/blobdiff - osl.c
Move para_truncate from osl.c to fd.c.
[osl.git] / osl.c
diff --git a/osl.c b/osl.c
index f0506a50821f1d095ec543a655022d46ece212bf..3e41c530399579c4400d6a4d0d879c9e50576539 100644 (file)
--- a/osl.c
+++ b/osl.c
@@ -44,7 +44,7 @@ __export const char *osl_strerror(int num)
        return msgstr.str + errmsgidx[num];
 }
 
-static int loglevel;
+int loglevel = 0;
 
 static void __attribute ((constructor)) init_loglevel(void)
 {
@@ -1178,37 +1178,6 @@ static int append_row_index(const struct osl_table *t, char *row_index)
        return ret;
 }
 
-/**
- * A wrapper for truncate(2)
- *
- * \param path Name of the regular file to truncate
- * \param size Number of bytes to \b shave \b off
- *
- * Truncate the regular file named by \a path by \a size bytes.
- *
- * \return Standard.
- *
- * \sa truncate(2)
- */
-int para_truncate(const char *path, off_t size)
-{
-       int ret;
-       struct stat statbuf;
-
-       ret = -E_OSL_STAT;
-       if (stat(path, &statbuf) < 0)
-               goto out;
-       ret = -E_OSL_BAD_SIZE;
-       if (statbuf.st_size < size)
-               goto out;
-       ret = -E_OSL_TRUNC;
-       if (truncate(path, statbuf.st_size - size) < 0)
-               goto out;
-       ret = 1;
-out:
-       return ret;
-}
-
 static int truncate_mapped_file(const struct osl_table *t, unsigned col_num,
                off_t size)
 {