Changeset 178 for trunk/src/common.c
- Timestamp:
- 03/13/10 12:56:36 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common.c
r172 r178 38 38 39 39 40 /* Windows is lame */ 41 #ifdef O_BINARY 42 #define REGLOOKUP_OPEN_FLAGS O_RDONLY|O_BINARY 43 #else 44 #define REGLOOKUP_OPEN_FLAGS O_RDONLY 45 #endif 46 47 40 48 void bailOut(int code, char* message) 41 49 { … … 337 345 return ret_val; 338 346 } 347 348 349 int openHive(const char* filename) 350 { 351 int ret_val; 352 353 /* open an existing file */ 354 if ((ret_val = open(filename, REGLOOKUP_OPEN_FLAGS)) == -1) 355 { 356 fprintf(stderr, "ERROR: Failed to open hive. Error returned: %s\n", 357 strerror(errno)); 358 return -1; 359 } 360 361 return ret_val; 362 } 363 364 365 void formatTime(const REGFI_NTTIME* nttime, char* output) 366 { 367 time_t tmp_time[1]; 368 struct tm* tmp_time_s = NULL; 369 370 *tmp_time = regfi_nt2unix_time(nttime); 371 tmp_time_s = gmtime(tmp_time); 372 strftime(output, 373 (4+1+2+1+2)+1+(2+1+2+1+2)+1, 374 "%Y-%m-%d %H:%M:%S", 375 tmp_time_s); 376 }
Note: See TracChangeset
for help on using the changeset viewer.