s3-util: for convenience, provide format comments in tdb_unpack().
[jra/samba/.git] / source3 / torture / utable.c
index e5126da91d3885d48e07448df2a664dc30223c6a..e36b0388c4ed42a1c1b80ff30a5d6ed13006ea9a 100644 (file)
@@ -5,7 +5,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
 
-BOOL torture_utable(int dummy)
+bool torture_utable(int dummy)
 {
        struct cli_state *cli;
        fstring fname, alt_name;
@@ -85,7 +84,11 @@ BOOL torture_utable(int dummy)
                d_printf("Failed to create valid.dat - %s", strerror(errno));
                return False;
        }
-       write(fd, valid, 0x10000);
+       if (write(fd, valid, 0x10000) != 0x10000) {
+               d_printf("Failed to create valid.dat - %s", strerror(errno));
+               close(fd);
+               return false;
+       }
        close(fd);
        d_printf("wrote valid.dat\n");
 
@@ -111,7 +114,7 @@ static char *form_name(int c)
        return fname;
 }
 
-BOOL torture_casetable(int dummy)
+bool torture_casetable(int dummy)
 {
        static struct cli_state *cli;
        char *fname;