OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This tool manages privacy blacklists. Primarily for loading a text | 5 // This tool manages privacy blacklists. Primarily for loading a text |
6 // blacklist into the binary aggregate blacklist. | 6 // blacklist into the binary aggregate blacklist. |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 int IMAIN(int argc, ICHAR* argv[]) { | 37 int IMAIN(int argc, ICHAR* argv[]) { |
38 base::EnableTerminationOnHeapCorruption(); | 38 base::EnableTerminationOnHeapCorruption(); |
39 | 39 |
40 if (argc < 3) | 40 if (argc < 3) |
41 return PrintUsage(argc, argv); | 41 return PrintUsage(argc, argv); |
42 | 42 |
43 BlacklistIO io; | 43 BlacklistIO io; |
44 for (int current = 1; current < argc-1; ++current) { | 44 for (int current = 1; current < argc-1; ++current) { |
45 FilePath input(argv[current]); | 45 FilePath input(argv[current]); |
46 if (!io.Read(input)) { | 46 if (!io.Read(input)) { |
47 ICERR << "Error reading input file " << argv[current] << "\n"; | 47 ICERR << "Error reading " << argv[current] << ":\n" |
| 48 << io.last_error() << "\n"; |
48 return -1; | 49 return -1; |
49 } | 50 } |
50 } | 51 } |
51 | 52 |
52 FilePath output(argv[argc-1]); | 53 FilePath output(argv[argc-1]); |
53 if (!io.Write(output)) | 54 if (!io.Write(output)) |
54 ICERR << "Error writing output file " << argv[2] << "\n"; | 55 ICERR << "Error writing " << argv[2] << ":\n" << io.last_error() << "\n"; |
55 | 56 |
56 return 0; | 57 return 0; |
57 } | 58 } |
OLD | NEW |