lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

0009-Rename-dprintf-to-dbg_printf.patch (9349B)


      1 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
      2 Date: Thu, 24 Oct 2013 01:11:21 -0200
      3 Subject: Rename dprintf to dbg_printf
      4 
      5 ---
      6  fsck_hfs.tproj/dfalib/SRepair.c  | 18 +++++++++---------
      7  fsck_hfs.tproj/dfalib/SVerify1.c |  6 +++---
      8  fsck_hfs.tproj/fsck_debug.c      | 10 +++++-----
      9  fsck_hfs.tproj/fsck_debug.h      | 10 +++++-----
     10  4 files changed, 22 insertions(+), 22 deletions(-)
     11 
     12 diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c
     13 index 8eb759c..89c12d6 100644
     14 --- a/fsck_hfs.tproj/dfalib/SRepair.c
     15 +++ b/fsck_hfs.tproj/dfalib/SRepair.c
     16 @@ -1825,13 +1825,13 @@ static OSErr FixAttrSize(SGlobPtr GPtr, RepairOrderPtr p)
     17  	result = BTSearchRecord(GPtr->calculatedAttributesFCB, &iterator, 
     18  				kInvalidMRUCacheKey, &btRecord, &recSize, &iterator);
     19  	if (result) {
     20 -		dprintf (d_error|d_xattr, "%s: Cannot find attribute record (err = %d)\n", __FUNCTION__, result);
     21 +		dbg_printf (d_error|d_xattr, "%s: Cannot find attribute record (err = %d)\n", __FUNCTION__, result);
     22  		goto out;
     23  	}
     24  
     25  	/* We should only get record of type kHFSPlusAttrForkData */
     26  	if (record.recordType != kHFSPlusAttrForkData) {
     27 -		dprintf (d_error|d_xattr, "%s: Record found is not attribute fork data\n", __FUNCTION__);
     28 +		dbg_printf (d_error|d_xattr, "%s: Record found is not attribute fork data\n", __FUNCTION__);
     29  		result = btNotFound;
     30  		goto out;
     31  	}
     32 @@ -1862,7 +1862,7 @@ static OSErr FixAttrSize(SGlobPtr GPtr, RepairOrderPtr p)
     33  		result = BTReplaceRecord(GPtr->calculatedAttributesFCB, &iterator,
     34  					&btRecord, recSize);
     35  		if (result) {
     36 -			dprintf (d_error|d_xattr, "%s: Cannot replace attribute record (err=%d)\n", __FUNCTION__, result);
     37 +			dbg_printf (d_error|d_xattr, "%s: Cannot replace attribute record (err=%d)\n", __FUNCTION__, result);
     38  			goto out;
     39  		}
     40  	}
     41 @@ -2058,7 +2058,7 @@ del_overflow_extents:
     42  
     43  		/* Delete the extent record */ 
     44  		err = DeleteBTreeRecord(GPtr->calculatedExtentsFCB, &extentKey);
     45 -		dprintf (d_info, "%s: Deleting extent overflow for fileID=%u, forkType=%u, startBlock=%u\n", __FUNCTION__, fileID, forkType, foundStartBlock);
     46 +		dbg_printf (d_info, "%s: Deleting extent overflow for fileID=%u, forkType=%u, startBlock=%u\n", __FUNCTION__, fileID, forkType, foundStartBlock);
     47  		if (err) {
     48  			goto create_symlink;
     49  		}
     50 @@ -3227,12 +3227,12 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
     51  											  &extentData, &recordSize, &foundExtentIndex);
     52  				foundLocation = extentsBTree;
     53  				if (err != noErr) {
     54 -					dprintf (d_error|d_overlap, "%s: No matching extent record found in extents btree for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
     55 +					dbg_printf (d_error|d_overlap, "%s: No matching extent record found in extents btree for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
     56  					goto out;
     57  				}
     58  			} else {
     59  				/* No more extents exist for this file */
     60 -				dprintf (d_error|d_overlap, "%s: No matching extent record found for fileID = %d\n", __FUNCTION__, extentInfo->fileID);
     61 +				dbg_printf (d_error|d_overlap, "%s: No matching extent record found for fileID = %d\n", __FUNCTION__, extentInfo->fileID);
     62  				goto out;
     63  			}
     64  		}
     65 @@ -3241,7 +3241,7 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
     66  	err = CopyDiskBlocks(GPtr, extentInfo->startBlock, extentInfo->blockCount, 
     67  						 extentInfo->newStartBlock);
     68  	if (err != noErr) {
     69 -		dprintf (d_error|d_overlap, "%s: Error in copying disk blocks for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
     70 +		dbg_printf (d_error|d_overlap, "%s: Error in copying disk blocks for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
     71  		goto out;
     72  	}
     73  	
     74 @@ -3260,7 +3260,7 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
     75  
     76  	}
     77  	if (err != noErr) {
     78 -		dprintf (d_error|d_overlap, "%s: Error in updating extent record for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
     79 +		dbg_printf (d_error|d_overlap, "%s: Error in updating extent record for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
     80  		goto out;
     81  	}
     82  
     83 @@ -3491,7 +3491,7 @@ static OSErr SearchExtentInAttributeBT(SGlobPtr GPtr, ExtentInfo *extentInfo,
     84  	result = BTSearchRecord(GPtr->calculatedAttributesFCB, &iterator, 
     85  				kInvalidMRUCacheKey, &btRecord, recordSize, &iterator);
     86  	if (result) {
     87 -		dprintf (d_error|d_overlap, "%s: Error finding attribute record (err=%d) for fileID = %d, attrname = %d\n", __FUNCTION__, result, extentInfo->fileID, extentInfo->attrname);
     88 +		dbg_printf (d_error|d_overlap, "%s: Error finding attribute record (err=%d) for fileID = %d, attrname = %d\n", __FUNCTION__, result, extentInfo->fileID, extentInfo->attrname);
     89  		goto out;	
     90  	}
     91  	
     92 diff --git a/fsck_hfs.tproj/dfalib/SVerify1.c b/fsck_hfs.tproj/dfalib/SVerify1.c
     93 index a273bf3..39bda5c 100644
     94 --- a/fsck_hfs.tproj/dfalib/SVerify1.c
     95 +++ b/fsck_hfs.tproj/dfalib/SVerify1.c
     96 @@ -2157,9 +2157,9 @@ CheckAttributeRecord(SGlobPtr GPtr, const HFSPlusAttrKey *key, const HFSPlusAttr
     97  	
     98  	if (doDelete == true) {
     99  		result = DeleteBTreeRecord(GPtr->calculatedAttributesFCB, key);
    100 -		dprintf (d_info|d_xattr, "%s: Deleting attribute %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
    101 +		dbg_printf (d_info|d_xattr, "%s: Deleting attribute %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
    102  		if (result) {
    103 -			dprintf (d_error|d_xattr, "%s: Error in deleting record for %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
    104 +			dbg_printf (d_error|d_xattr, "%s: Error in deleting record for %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
    105  		}
    106  		
    107  		/* Set flags to mark header and map dirty */
    108 @@ -3034,7 +3034,7 @@ OSErr	CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
    109  		//	checkout the extent record first
    110  		err = ChkExtRec( GPtr, extents, &lastExtentIndex );
    111  		if (err != noErr) {
    112 -			dprintf (d_info, "%s: Bad extent for fileID %u in extent %u for startblock %u\n", __FUNCTION__, fileNumber, lastExtentIndex, blockCount);
    113 +			dbg_printf (d_info, "%s: Bad extent for fileID %u in extent %u for startblock %u\n", __FUNCTION__, fileNumber, lastExtentIndex, blockCount);
    114  
    115  			/* Stop verification if bad extent is found for system file or EA */
    116  			if ((fileNumber < kHFSFirstUserCatalogNodeID) ||
    117 diff --git a/fsck_hfs.tproj/fsck_debug.c b/fsck_hfs.tproj/fsck_debug.c
    118 index 1be3fc5..77e8e51 100644
    119 --- a/fsck_hfs.tproj/fsck_debug.c
    120 +++ b/fsck_hfs.tproj/fsck_debug.c
    121 @@ -25,18 +25,18 @@
    122  #include <stdio.h>
    123  #include <stdarg.h>
    124  
    125 -/* Current debug level of fsck_hfs for printing messages via dprintf */
    126 +/* Current debug level of fsck_hfs for printing messages via dbg_printf */
    127  unsigned long cur_debug_level;
    128  
    129 -/* Function: dprintf
    130 +/* Function: dbg_printf
    131   *
    132   * Description: Debug function similar to printf except the first parameter
    133 - * which indicates the type of message to be printed by dprintf. Based on 
    134 + * which indicates the type of message to be printed by dbg_printf. Based on
    135   * current debug level and the type of message, the function decides 
    136   * whether to print the message or not.
    137   *
    138   * Each unique message type has a bit assigned to it.  The message type 
    139 - * passed to dprintf can be one or combination (OR-ed value) of pre-defined 
    140 + * passed to dbg_printf can be one or combination (OR-ed value) of pre-defined
    141   * debug message types.  Only the messages whose type have one or more similar
    142   * bits set in comparison with current global debug level are printed. 
    143   *
    144 @@ -56,7 +56,7 @@ unsigned long cur_debug_level;
    145   * Output:
    146   *	Nothing
    147   */
    148 -void dprintf (unsigned long type, char *fmt, ...) 
    149 +void dbg_printf (unsigned long type, char *fmt, ...)
    150  {
    151  	if (cur_debug_level & type) {
    152  		va_list ap;
    153 diff --git a/fsck_hfs.tproj/fsck_debug.h b/fsck_hfs.tproj/fsck_debug.h
    154 index 81e3932..cb1b9be 100644
    155 --- a/fsck_hfs.tproj/fsck_debug.h
    156 +++ b/fsck_hfs.tproj/fsck_debug.h
    157 @@ -36,18 +36,18 @@ enum debug_message_type {
    158  	d_overlap	=	0x0020 	/* Overlap extents related messages */
    159  };
    160  
    161 -/* Current debug level of fsck_hfs for printing messages via dprintf */
    162 +/* Current debug level of fsck_hfs for printing messages via dbg_printf */
    163  extern unsigned long cur_debug_level;
    164  
    165 -/* Function: dprintf
    166 +/* Function: dbg_printf
    167   *
    168   * Description: Debug function similar to printf except the first parameter
    169 - * which indicates the type of message to be printed by dprintf. Based on 
    170 + * which indicates the type of message to be printed by dbg_printf. Based on
    171   * current debug level and the type of message, the function decides 
    172   * whether to print the message or not.
    173   *
    174   * Each unique message type has a bit assigned to it.  The message type 
    175 - * passed to dprintf can be one or combination (OR-ed value) of pre-defined 
    176 + * passed to dbg_printf can be one or combination (OR-ed value) of pre-defined
    177   * debug message types.  Only the messages whose type have one or more similar
    178   * bits set in comparison with current global debug level are printed. 
    179   *
    180 @@ -67,6 +67,6 @@ extern unsigned long cur_debug_level;
    181   * Output:
    182   *	Nothing
    183   */
    184 -extern void dprintf (unsigned long message_type, char *format, ...);
    185 +extern void dbg_printf (unsigned long message_type, char *format, ...);
    186  
    187  #endif /* __FSCK_DEBUG__ */