X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=extras%2Fvolume_id%2Flib%2Fudf.c;h=aed0d76b52ed073d9770ca28fa44766145a4fe27;hb=0bf41e6c24ac3d8cea08dd965e29b0d66ef51f1a;hp=ac2f40a9e88429b0f9af567c2a7958da49280916;hpb=cdf18948639e56d2e3c71606c72e2f2d239c100b;p=elogind.git diff --git a/extras/volume_id/lib/udf.c b/extras/volume_id/lib/udf.c index ac2f40a9e..aed0d76b5 100644 --- a/extras/volume_id/lib/udf.c +++ b/extras/volume_id/lib/udf.c @@ -3,19 +3,24 @@ * * Copyright (C) 2004 Kay Sievers * - * 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 version 2 of the License. + * 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 + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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, see . */ #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif -#ifdef HAVE_CONFIG_H -# include -#endif - #include #include #include @@ -24,7 +29,7 @@ #include #include "libvolume_id.h" -#include "util.h" +#include "libvolume_id-private.h" struct volume_descriptor { struct descriptor_tag { @@ -72,7 +77,7 @@ int volume_id_probe_udf(struct volume_id *id, uint64_t off, uint64_t size) unsigned int loc; unsigned int clen; - info("probing at offset 0x%llx", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); vsd = (struct volume_structure_descriptor *) volume_id_get_buffer(id, off + UDF_VSD_OFFSET, 0x200); if (vsd == NULL) @@ -100,7 +105,7 @@ blocksize: vsd = (struct volume_structure_descriptor *) volume_id_get_buffer(id, off + UDF_VSD_OFFSET + bs, 0x800); if (vsd == NULL) return -1; - dbg("test for blocksize: 0x%x", bs); + dbg("test for blocksize: 0x%x\n", bs); if (vsd->id[0] != '\0') goto nsr; } @@ -113,7 +118,7 @@ nsr: if (vsd == NULL) return -1; - dbg("vsd: %c%c%c%c%c", + dbg("vsd: %c%c%c%c%c\n", vsd->id[0], vsd->id[1], vsd->id[2], vsd->id[3], vsd->id[4]); if (vsd->id[0] == '\0') @@ -138,7 +143,7 @@ anchor: /* get desriptor list address and block count */ count = le32_to_cpu(vd->type.anchor.length) / bs; loc = le32_to_cpu(vd->type.anchor.location); - dbg("0x%x descriptors starting at logical secor 0x%x", count, loc); + dbg("0x%x descriptors starting at logical secor 0x%x\n", count, loc); /* pick the primary descriptor from the list */ for (b = 0; b < count; b++) { @@ -147,7 +152,7 @@ anchor: return -1; type = le16_to_cpu(vd->tag.id); - dbg("descriptor type %i", type); + dbg("descriptor type %i\n", type); /* check validity */ if (type == 0) @@ -164,7 +169,7 @@ pvd: volume_id_set_label_raw(id, &(vd->type.primary.ident.clen), 32); clen = vd->type.primary.ident.clen; - dbg("label string charsize=%i bit", clen); + dbg("label string charsize=%i bit\n", clen); if (clen == 8) volume_id_set_label_string(id, vd->type.primary.ident.c, 31); else if (clen == 16)