[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: EXT2FS Problems -- Interesting Code Snippet



One other thing that is probably not a problem, but
caught my eye, is the way the conditional operator
is used here:

+      result = ext2_new_block
+	(goal,
+	 S_ISREG (node->dn_stat.st_mode)
+	 ? (sblock->s_prealloc_blocks ?: EXT2_DEFAULT_PREALLOC_BLOCKS)
                                    ^^^
+	 : (S_ISDIR (node->dn_stat.st_mode)
+	    && EXT2_HAS_COMPAT_FEATURE(sblock,
+				       EXT2_FEATURE_COMPAT_DIR_PREALLOC))
+	 ? sblock->s_prealloc_dir_blocks
+	 : 0,
+	 &node->dn->info.i_prealloc_count,
+	 &node->dn->info.i_prealloc_block);

Will this construct (?:) result in the conditional passing
a NULL to the ext2_new_block method?  On IBM's compiler
for AIX this won't even compile.

-Brent


Reply to: