You seem to have some misunderstanding that there is some universal standard that denotes 0 = success, others = failure. This is not the case. Return values are per program, and defined in the manual. Some programs do not generate information which should be returned using return value, but only return error / success in which case it's easy to just decide 0 = success, others = failure codes. Some programs, like diff, return the result of the program (differs; no difference), and also have to return errors. They chose the codes as described on the manual you can't read. Some others have chosen negative codes for errors, 0 for success, and positive numbers for non-error status codes, which is quite nice. Whoever wrote diff didn't do that, but that's OK too.