Skip to content

Commit

Permalink
remove unused .control.printer_reset
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Nov 6, 2013
1 parent c62716a commit adfc149
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions agent-system/src/SystemAgent.cc
Expand Up @@ -1397,46 +1397,6 @@ SystemAgent::Execute (const YCPPath& path, const YCPValue& value,

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

else if (cmd == "control")
{

if (path->length()<2)
return YCPError(string("Undefined subpath for Execute (.control."));

if (path->component_str(1) == "printer_reset")
{

/**
* @builtin Execute (.target.control.printer_reset, string device) -> boolean
* Reset the given printer (trigger ioctl)
*
* The return value is true or false, depending of the success
*
*/

if (value.isNull() || !value->isString())
{
return YCPError ("Bad filename in Execute (.control.printer_reset, string device");
}

string device = value->asString()->value();

int fd = open(device.c_str(), O_RDWR);
if (fd < 0)
{
return YCPError (string("Open failed: \"" + device + "\" " + string(strerror(errno)?:"")));
}

int ret = ioctl(fd, LPRESET, NULL);
close(fd);

return YCPBoolean (ret == 0);
}

}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

return YCPError (string("Undefined subpath for Execute (") + path->toString() + ")");
}

Expand Down

0 comments on commit adfc149

Please sign in to comment.