Changes by: uvman
Update of /cvs/linux-ntfs/ntfsprogs/libntfs
In directory delta357:/tmp/cvs-serv9592/libntfs
Modified Files:
logging.c
Log Message:
Fix compilation on environments that one can not assign to "va_list args" (e.g. Debian Alpha). Do so by removing the unused log_reason code. Originally, Szaka asked FlatCap for it but never used it. I've asked Szaka if he is going to use it but he did not reply. I got an implicit answer in the form of ntfs-3g commit. Therefore, commit an updated version of the patch I've sent the Debian package maintainer.
Index: logging.c
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/libntfs/logging.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- logging.c 25 Sep 2006 16:58:38 -0000 1.12
+++ logging.c 1 Nov 2006 14:05:09 -0000 1.13
@@ -77,7 +77,7 @@ static struct ntfs_logging ntfs_log = {
#endif
NTFS_LOG_LEVEL_INFO | NTFS_LOG_LEVEL_QUIET | NTFS_LOG_LEVEL_WARNING |
NTFS_LOG_LEVEL_ERROR | NTFS_LOG_LEVEL_PERROR | NTFS_LOG_LEVEL_CRITICAL |
- NTFS_LOG_LEVEL_REASON | NTFS_LOG_LEVEL_PROGRESS,
+ NTFS_LOG_LEVEL_PROGRESS,
NTFS_LOG_FLAG_ONLYNAME,
#ifdef DEBUG
ntfs_log_handler_outerr
@@ -346,26 +346,9 @@ int ntfs_log_handler_syslog(const char *
const char *file, __attribute__((unused)) int line, u32 level,
void *data __attribute__((unused)), const char *format, va_list args)
{
- const int reason_size = 128;
- static char *reason = NULL;
int ret = 0;
int olderr = errno;
- if (level == NTFS_LOG_LEVEL_REASON) {
- if (!reason)
- reason = malloc(reason_size);
- if (reason) {
- memset(reason, 0, reason_size);
- return vsnprintf(reason, reason_size, format, args);
- } else {
- /* Rather than call ourselves, just drop through */
- level = NTFS_LOG_LEVEL_PERROR;
- format = "Couldn't create reason";
- args = NULL;
- olderr = errno;
- }
- }
-
if ((ntfs_log.flags & NTFS_LOG_FLAG_ONLYNAME) &&
(strchr(file, PATH_SEP))) /* Abbreviate the filename */
file = strrchr(file, PATH_SEP) + 1;
@@ -385,12 +368,8 @@ int ntfs_log_handler_syslog(const char *
ret += vfprintf(stream, format, args);
- if (level & NTFS_LOG_LEVEL_PERROR) {
- if (reason)
- ret += fprintf(stream, " : %s\n", reason);
- else
- ret += fprintf(stream, " : %s\n", strerror(olderr));
- }
+ if (level & NTFS_LOG_LEVEL_PERROR)
+ ret += fprintf(stream, ": %s\n", strerror(olderr));
#endif
vsyslog(LOG_NOTICE, format, args);
ret = 1; /* FIXME: caclulate how many bytes had been written. */
@@ -424,8 +403,6 @@ int ntfs_log_handler_syslog(const char *
int ntfs_log_handler_fprintf(const char *function, const char *file,
int line, u32 level, void *data, const char *format, va_list args)
{
- const int reason_size = 128;
- static char *reason = NULL;
int ret = 0;
int olderr = errno;
FILE *stream;
@@ -436,21 +413,6 @@ int ntfs_log_handler_fprintf(const char
return 0; /* If it's NULL, we can't do anything. */
stream = (FILE*)data;
- if (level == NTFS_LOG_LEVEL_REASON) {
- if (!reason)
- reason = malloc(reason_size);
- if (reason) {
- memset(reason, 0, reason_size);
- return vsnprintf(reason, reason_size, format, args);
- } else {
- /* Rather than call ourselves, just drop through */
- level = NTFS_LOG_LEVEL_PERROR;
- format = "Couldn't create reason";
- args = NULL;
- olderr = errno;
- }
- }
-
if (ntfs_log.flags & NTFS_LOG_FLAG_COLOUR) {
/* Pick a colour determined by the log level */
switch (level) {
@@ -500,12 +462,8 @@ int ntfs_log_handler_fprintf(const char
ret += vfprintf(stream, format, args);
- if (level & NTFS_LOG_LEVEL_PERROR) {
- if (reason)
- ret += fprintf(stream, " : %s\n", reason);
- else
- ret += fprintf(stream, " : %s\n", strerror(olderr));
- }
+ if (level & NTFS_LOG_LEVEL_PERROR)
+ ret += fprintf(stream, ": %s\n", strerror(olderr));
if (col_suffix)
ret += fprintf(stream, col_suffix);
|