Lines Matching refs:dbname
3302 char *dbname = NULL; in apprentice_map() local
3313 dbname = mkdbname(ms, fn, 0); in apprentice_map()
3314 if (dbname == NULL) in apprentice_map()
3317 if ((fd = open(dbname, O_RDONLY|O_BINARY)) == -1) in apprentice_map()
3321 file_error(ms, errno, "cannot stat `%s'", dbname); in apprentice_map()
3325 file_error(ms, 0, "file `%s' is too %s", dbname, in apprentice_map()
3335 file_error(ms, errno, "cannot map `%s'", dbname); in apprentice_map()
3352 if (check_buffer(ms, map, dbname) != 0) { in apprentice_map()
3357 file_error(ms, errno, "cannot mprotect `%s'", dbname); in apprentice_map()
3362 free(dbname); in apprentice_map()
3369 free(dbname); in apprentice_map()
3374 check_buffer(struct magic_set *ms, struct magic_map *map, const char *dbname) in check_buffer() argument
3384 entries, dbname); in check_buffer()
3390 dbname, map->len, sizeof(struct magic)); in check_buffer()
3397 file_error(ms, 0, "bad magic in `%s'", dbname); in check_buffer()
3410 VERSIONNO, dbname, version); in check_buffer()
3426 dbname, entries, nentries + 1); in check_buffer()
3445 char *dbname; in apprentice_compile() local
3453 dbname = mkdbname(ms, fn, 1); in apprentice_compile()
3455 if (dbname == NULL) in apprentice_compile()
3458 if ((fd = open(dbname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644)) == -1) in apprentice_compile()
3460 file_error(ms, errno, "cannot open `%s'", dbname); in apprentice_compile()
3469 file_error(ms, errno, "error writing `%s'", dbname); in apprentice_compile()
3476 file_error(ms, errno, "error writing `%s'", dbname); in apprentice_compile()
3487 free(dbname); in apprentice_compile()