Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | /*********************************************************************** |
michael@0 | 7 | ** |
michael@0 | 8 | ** Name: op_filnf.c |
michael@0 | 9 | ** |
michael@0 | 10 | ** Description: Test Program to verify the PR_FILE_NOT_FOUND_ERROR |
michael@0 | 11 | ** This test program also uses the TRUNCATE option |
michael@0 | 12 | ** |
michael@0 | 13 | ** Modification History: |
michael@0 | 14 | ** 03-June-97 AGarcia- Initial version |
michael@0 | 15 | ***********************************************************************/ |
michael@0 | 16 | |
michael@0 | 17 | /*********************************************************************** |
michael@0 | 18 | ** Includes |
michael@0 | 19 | ***********************************************************************/ |
michael@0 | 20 | /* Used to get the command line option */ |
michael@0 | 21 | #include "prinit.h" |
michael@0 | 22 | #include "prmem.h" |
michael@0 | 23 | #include "prio.h" |
michael@0 | 24 | #include "prerror.h" |
michael@0 | 25 | #include <stdio.h> |
michael@0 | 26 | #include "plgetopt.h" |
michael@0 | 27 | |
michael@0 | 28 | static PRFileDesc *t1; |
michael@0 | 29 | PRIntn error_code; |
michael@0 | 30 | |
michael@0 | 31 | int main(int argc, char **argv) |
michael@0 | 32 | { |
michael@0 | 33 | PR_STDIO_INIT(); |
michael@0 | 34 | t1 = PR_Open("/usr/tmp/ttools/err03.tmp", PR_TRUNCATE | PR_RDWR, 0666); |
michael@0 | 35 | if (t1 == NULL) { |
michael@0 | 36 | if (PR_GetError() == PR_FILE_NOT_FOUND_ERROR) { |
michael@0 | 37 | printf ("error code is %d \n", PR_GetError()); |
michael@0 | 38 | printf ("PASS\n"); |
michael@0 | 39 | return 0; |
michael@0 | 40 | } |
michael@0 | 41 | else { |
michael@0 | 42 | printf ("error code is %d \n", PR_GetError()); |
michael@0 | 43 | printf ("FAIL\n"); |
michael@0 | 44 | return 1; |
michael@0 | 45 | } |
michael@0 | 46 | } |
michael@0 | 47 | PR_Close(t1); |
michael@0 | 48 | printf ("opened a file that should not exist\n"); |
michael@0 | 49 | printf ("FAIL\n"); |
michael@0 | 50 | return 1; |
michael@0 | 51 | } |