nixpkgs/pkgs/by-name/hd/hddtemp/satacmds.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

27 lines
986 B
Diff

diff -Naurp hddtemp-0.3-beta15-orig/src/satacmds.c hddtemp-0.3-beta15/src/satacmds.c
--- hddtemp-0.3-beta15-orig/src/satacmds.c 2007-02-10 14:25:15.000000000 +0100
+++ hddtemp-0.3-beta15/src/satacmds.c 2007-02-10 14:26:53.000000000 +0100
@@ -54,7 +54,6 @@ int sata_pass_thru(int device, unsigned
unsigned char cdb[16];
unsigned char sense[32];
int dxfer_direction;
- int ret;
memset(cdb, 0, sizeof(cdb));
cdb[0] = ATA_16;
@@ -78,13 +77,7 @@ int sata_pass_thru(int device, unsigned
cdb[6] = cmd[1];
cdb[14] = cmd[0];
- ret = scsi_SG_IO(device, cdb, sizeof(cdb), buffer, cmd[3] * 512, sense, sizeof(sense), dxfer_direction);
-
- /* Verify SATA magics */
- if (sense[0] != 0x72 || sense[7] != 0x0e || sense[9] != 0x0e || sense[10] != 0x00)
- return 1;
- else
- return ret;
+ return scsi_SG_IO(device, cdb, sizeof(cdb), buffer, cmd[3] * 512, sense, sizeof(sense), dxfer_direction);
}
void sata_fixstring(unsigned char *s, int bytecount)