mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
3.1 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/kiss/eject_feature.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. An eject functionality is rather handy on software controlled CD-ROM
  20. laptops (e.g. Apple ones) ...
  21. - Rene Rebe <rene@exactcode.de>
  22. --- kiss-0.21/src/Makefile 1998-09-25 14:07:09.000000000 +0200
  23. +++ kiss-0.21-eject/src/Makefile 2004-03-06 15:11:57.000000000 +0100
  24. @@ -66,7 +66,7 @@
  25. addstringstack.o expandtilde.o splitcmd.o addstringtostack.o \
  26. dokill.o dogrep.o dochown.o dosleep.o expandbackquotes.o dols.o \
  27. listdir.o listfile.o listoutput.o domknod.o dowc.o domount.o \
  28. - doumount.o dotouch.o
  29. + doumount.o dotouch.o doeject.o
  30. # entry point for making
  31. foo:
  32. --- kiss-0.21/src/doeject.c 1970-01-01 01:00:00.000000000 +0100
  33. +++ kiss-0.21-eject/src/doeject.c 2004-03-06 17:08:46.000000000 +0100
  34. @@ -0,0 +1,37 @@
  35. +#include "kiss.h"
  36. +
  37. +#if __GNUC__ == 3 && __GNUC_MINOR__ > 2
  38. +#define __attribute_const__ __attribute__ ((const))
  39. +#endif
  40. +
  41. +#include <linux/cdrom.h>
  42. +
  43. +int doeject (Stringstack s)
  44. +{
  45. + register int
  46. + i;
  47. +
  48. + /* need at least one arg */
  49. + if (s.nstr == 1) {
  50. + error ("Bad commandline.\n"
  51. + "Usage: %s device\n", progname);
  52. + return (0);
  53. + }
  54. +
  55. + for (i = 1; i < s.nstr; i++) {
  56. + int status;
  57. + int fd = open(s.str[i], O_RDONLY|O_NONBLOCK);
  58. +
  59. + if (fd == -1) {
  60. + warning ("%s: unable to open %s\n", progname, s.str[i]);
  61. + continue;
  62. + }
  63. +
  64. + status = ioctl(fd, CDROMEJECT);
  65. + if (status != 0) {
  66. + error ("%s: failed\n");
  67. + }
  68. + close (fd);
  69. + }
  70. + return (0);
  71. +}
  72. --- kiss-0.21/src/kiss.c 1998-09-25 14:07:10.000000000 +0200
  73. +++ kiss-0.21-eject/src/kiss.c 2004-03-06 15:11:57.000000000 +0100
  74. @@ -32,6 +32,7 @@
  75. { "chown", dochown, 0 },
  76. { "cp", docp, 0 },
  77. { "echo", doecho, 0 },
  78. + { "eject", doeject, 0 },
  79. { "exec", doexec, 1 },
  80. { "exit", doquit, 1 },
  81. { "grep", dogrep, 0 },
  82. --- kiss-0.21/src/kiss.h 1998-09-25 14:07:10.000000000 +0200
  83. +++ kiss-0.21-eject/src/kiss.h 2004-03-06 15:11:57.000000000 +0100
  84. @@ -194,6 +194,7 @@
  85. extern int dochown (Stringstack s);
  86. extern int docp (Stringstack s);
  87. extern int doecho (Stringstack s);
  88. +extern int doeject (Stringstack s);
  89. extern int doexec (Stringstack s);
  90. extern int dogrep (Stringstack s);
  91. extern int dohelp (Stringstack s);